-
Notifications
You must be signed in to change notification settings - Fork 530
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
[Question] Is there an option to omit optional members of a resource (links) #444
Comments
There isn't an option for excluding |
👍 |
in the meantime, what's the best way of getting this done in the application layer? subclass the serializer and override #serialize_to_links_hash? |
@lgebhardt @clumsysnake any ideas on this? Having same issue, i.e. would like to omit |
I haven't worked on this feature yet. I don't have a good work around at this point. |
@lgebhardt how about just making it an option that can be passed to |
@lgebhardt if you can point me in the right direction I'll take a shot at implementing this, we really need it 😅 |
I get around this by specifying the fields I want. Not sure if it's supposed to work like this or not, but:
produces:
If you need any of the related resources, include them as well. It's ugly but does cut down on payload sizes when you don't need related resources. |
after PR #893 it will be possible to allow resource to decide if his relationships has links. For example: add options to relationships like default values for |
Closed in favor of #594. |
In a resource object I'd like to omit the
links
object, see http://jsonapi.org/format/#document-resource-objectsI have a long list of objects with one attribute and only need the
id
,type
andattributes
members of the resource object.Is there an option to omit optional members of a resource (links)?
The text was updated successfully, but these errors were encountered: