Skip to content

fix(hydra): keep jsonapi input schemas out of the json rewrite - #8741

Open
soyuka wants to merge 2 commits into
api-platform:5.0from
soyuka:fix/hydra-jsonapi-input-schema
Open

soyuka wants to merge 2 commits into
api-platform:5.0from
soyuka:fix/hydra-jsonapi-input-schema

Conversation

@soyuka

@soyuka soyuka commented Oct 19, 2026

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

Since #7397 the Hydra schema factory rewrites every input schema to json. It wraps the JSON:API factory, so with jsonld enabled (the default) JSON:API request bodies were documented as plain objects, without the data/attributes/relationships envelope the denormalizer reads.

  • only jsonapi is excluded from the rewrite, every other format is byte-identical in the exported document (measured on the fixture app: only the 734 application/vnd.api+json request bodies change, 0 existing components change)
  • JSON:API input definitions get an .input postfix (Dummy.jsonapi.input), otherwise they share the name of the output definition, which requires data.id and documents included (wrong for POST, see fix(jsonapi): do not require id in input schema for post operations #8252)
  • the input definition doesn't document included

Known leftovers: 20 unreferenced *.jsonMergePatch / *.partial components appear in the export, built by the JSON:API factory to derive its envelope for PATCH/PUT. The relationship loop touched here also changes on 4.4 in #8734, expect a small conflict on the merge-up.

The Hydra schema factory rewrote every input schema to json. Because it
wraps the JSON:API factory, a jsonapi request body was documented as a
plain object without the data/attributes/relationships envelope
whenever jsonld was enabled.

Only jsonapi is now excluded from the rewrite, so other formats are
unchanged. JSON:API input definitions get an .input postfix, e.g.
Dummy.jsonapi.input, so they no longer share a name with the output
definition, which requires data.id and lists included. The input
definition requires only type on POST and drops 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