You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When include is used to include related documents (compound document) and you also have sparse fieldsets (you filter returned attributes with the fields parameter), the relationships attribute of the root resource remains empty.
This is rather confusing because this way you have no way how to link the root resources (if multiple) to their corresponding included related resources..
I've identified the issue to come from here: https://github.com/Netflix/fast_jsonapi/blob/master/lib/fast_jsonapi/serialization_core.rb#L54
It works as expected if that line is commented out...
Now I see a related issue: #304 - according to which there is a way to trick / work around this:
you must specify associations in the fields option if you want fast_jsonapi to populate the relationships hash appropriately
But I'm not sure if this is the JSONAPI v1 compliant way ...
So, if this is not considered a bug, maybe some documentation improvements should make this clear.
The text was updated successfully, but these errors were encountered:
When
include
is used to include related documents (compound document) and you also have sparse fieldsets (you filter returned attributes with thefields
parameter), therelationships
attribute of the root resource remains empty.This is rather confusing because this way you have no way how to link the root resources (if multiple) to their corresponding
included
related resources..I've identified the issue to come from here:
https://github.com/Netflix/fast_jsonapi/blob/master/lib/fast_jsonapi/serialization_core.rb#L54
It works as expected if that line is commented out...
Now I see a related issue: #304 - according to which there is a way to trick / work around this:
But I'm not sure if this is the JSONAPI v1 compliant way ...
So, if this is not considered a bug, maybe some documentation improvements should make this clear.
The text was updated successfully, but these errors were encountered: