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 ability to not to raise error when included field can't be retrieved #117

Open
andriiNyzhnik opened this issue May 25, 2018 · 2 comments

Comments

@andriiNyzhnik
Copy link

andriiNyzhnik commented May 25, 2018

I have different widgets. And provided them in index action.
Each widget type, has different/custom data. For that reason, I add different serializers for each widget type, to respond with that custom data.

The issue is that I have to include that data(different for each widget) in index action.
Gem raises an error in such case:

raise JSONAPI::Serializer::InvalidIncludeError.new("'#{attribute_name}' is not a valid include.")

I need to provide a way, to not to raise that error and just omit relationship if it can't be retrieved.

Can we merge it? Or maybe you can suggest me so other solution?

@fotinakis , @mwpastore what do you think guys?

Here is #118

@krainboltgreene
Copy link

Seems like a better approach would be to have includes no-op at the Policy level?

@andriiNyzhnik
Copy link
Author

Ok. Than we can close issue and PR

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