Skip to content
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

Add support for filtering included items #137

Open
mattcollum opened this issue Apr 24, 2018 · 1 comment
Open

Add support for filtering included items #137

mattcollum opened this issue Apr 24, 2018 · 1 comment

Comments

@mattcollum
Copy link

The JSON API spec suggests that an API may support an include parameter when fetching resources that allows the caller to specify which related resources to add to the included array. The current version of this library either marshalls all resources or none, depending on which API is used. The returned structs (OnePayload, ManyPayload) do not expose the underlying Included array of Nodes that contain the included items or any other way to control what is serialized. It would be great if the API can either add support for passing in which Node.Types to add to this array or at least expose it to the returned Payloader interface so callers can filter it themselves.

@ComaVN
Copy link

ComaVN commented Apr 30, 2019

+1 on this request. Perhaps it could be as simple as just not including any resource structs that only have a primary field?

See https://github.com/ComaVN/go-jsonapi-test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants