Closed hectorsq closed 7 years ago
This is expected behavior as fields
refers to the union of attributes
and relationships
. The fact that the relationships
member is not rendered in your example is simply a consequence of all relationships
being filtered out.
Given the following resources:
When I render in Rails using the following code (notice the commented lines)
I get the following JSON, where everything is fine:
If I filter some fields from the included resources:
I get the expected JSON:
However if I filter some fields from the main resource:
The relationships object is not rendered
I've found that adding the relationships in the fields hash fixes it
Rendering the expected JSON:
Is this a bug or is this the expected behavior?