-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix JSONApi sparse fieldset compliance for relationships #203
Fix JSONApi sparse fieldset compliance for relationships #203
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great catch! A few notes on making this safe to release ASAP.
Thx! Will make these changes and update this PR shortly. |
497242a
to
e7747a1
Compare
{_, view} -> view | ||
nil -> raise_invalid_field_names(type, view.type()) | ||
end | ||
end | ||
|
||
@spec is_field_valid_for_relationship({atom(), module()}, String.t()) :: boolean() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was the simplest way I could think of to handle the deprecation, but happy to take suggestions if needed.
e7747a1
to
0784120
Compare
instead of relationship name. see: https://jsonapi.org/format/#fetching-sparse-fieldsets - query_parser_test: fix a typo in test relationship definition
…arget resource type
0784120
to
6e9e9a6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for doing this @leepfrog!
Changes:
see: https://jsonapi.org/format/#fetching-sparse-fieldsets
Relevant section from the spec: "A client MAY request that an endpoint return only specific fields in the response on a per-type basis by including a fields[TYPE] parameter."