Closed olokobayusuf closed 6 years ago
Under the JSON:API spec, the value in the square brackets for ?fields[TYPE]
must match the value serialized in the resource object's type
key for the sparse fieldset list to take effect.
Subtypes are serialized with their parent type in the type
key (an intentional decision discussed #149), so the library's current behavior is actually correct per the JSON:API spec.
If you want to filter the subtype's fields, then, you actually have to put the supertype in the query string:
api.somewhere.com/B?fields[A]=someField,anotherField
A
, and another schemaB : A
A
,someField
andanotherField
GET
onB
with sparse field sets, the field sets are ignored (likely because they are not defined directly onB
):A
's fields areB
's fields