Skip to content

fix(jsonapi): describe included items as resource objects - #8743

Open
soyuka wants to merge 1 commit into
api-platform:5.0from
soyuka:fix/jsonapi-included-resource-object
Open

soyuka wants to merge 1 commit into
api-platform:5.0from
soyuka:fix/jsonapi-included-resource-object

Conversation

@soyuka

@soyuka soyuka commented Oct 19, 2026

Copy link
Copy Markdown
Member
Q A
Branch? 5.0
Tickets ∅
License MIT
Doc PR ∅

Follows #8734. included.items.anyOf referenced the related resource's document definition (X.jsonapi, i.e. {data: {...}}), but included items are bare resource objects ({id, type, attributes, relationships}), so real responses never validated against the documented schema.

The resource object now lives in its own X.jsonapi.resource definition, referenced by the document's data (and collection data.items) and by included, single source of truth. Measured on the fixture app export: 638 new *.resource components, no removed ones, and every existing component dereferences to exactly its previous shape. Consumers reading X.jsonapi.properties.data inline now get a $ref.

Expect a conflict with #8741 (same factory) depending on merge order.

included items referenced the related resource's whole document
definition ({data: {...}}) while the serializer emits bare resource
objects. Move the resource object to its own X.jsonapi.resource
definition, referenced by the document's data and by included.
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

Successfully merging this pull request may close these issues.

1 participant