Skip to content

fix(json-schema): nested resource ignores output DTO - #8652

Open
soyuka wants to merge 2 commits into
api-platform:5.0from
soyuka:fix/json-schema-nested-output-dto
Open

soyuka wants to merge 2 commits into
api-platform:5.0from
soyuka:fix/json-schema-nested-output-dto

Conversation

@soyuka

@soyuka soyuka commented Oct 7, 2026

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

An embedded related resource is serialized with the resource's own properties, the output: DTO only applies when the resource is fetched directly. The schema of a nested resource still described the output (or input) class of the guessed operation, so the documented shape did not match the response, in json and jsonld.

When building a forced subschema, ResourceMetadataTrait now picks the operation without the format and drops its input/output, and the Hydra decorator passes the provided operation down instead of re-resolving it by format.

Found while mapping Operation usage in json-schema for symfony/symfony#64279.

soyuka added 2 commits October 6, 2026 23:01
The serializer embeds a related resource with its own properties,
its output DTO only applies to a direct request on that resource.
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