Skip to content

fix(jsonapi): split schema relationships on the input/output class - #8728

Merged
soyuka merged 2 commits into
api-platform:5.0from
soyuka:fix/jsonapi-input-dto-collection-8698
Oct 19, 2026
Merged

soyuka merged 2 commits into
api-platform:5.0from
soyuka:fix/jsonapi-input-dto-collection-8698

Conversation

@soyuka

@soyuka soyuka commented Oct 19, 2026

Copy link
Copy Markdown
Member
Q A
Branch? 4.4
Tickets Fixes #8698
License MIT
Doc PR ∅

The JSON:API schema factory decided what goes under attributes vs relationships from the resource class, so an input DTO property holding plain objects was documented as resource linkage, while the denormalizer reads it from attributes. The split now uses the input/output class, which is also what the normalizer uses at runtime for output DTOs.

Covered with a unit test: with jsonld enabled, Hydra's schema factory currently rewrites every input schema request to json before the JSON:API factory runs, so JSON:API input schemas can't be observed through the functional kernel. That's a separate bug, fixed in a follow-up PR.

The attributes/relationships split was computed on the resource class,
so an input DTO property holding plain objects was documented as
resource linkage while the denormalizer reads it from attributes.

Fixes api-platform#8698
@soyuka
soyuka force-pushed the fix/jsonapi-input-dto-collection-8698 branch from 098b2b7 to c11090b Compare October 19, 2026 12:13
@soyuka
soyuka changed the base branch from 4.4 to 5.0 October 19, 2026 12:16
@soyuka
soyuka merged commit 1ad0bb4 into api-platform:5.0 Oct 19, 2026
117 checks passed
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