Skip to content

fix(jsonschema): keep property metadata on reference schemas - #8480

Open
gaetan-petit wants to merge 1 commit into
api-platform:4.3from
gaetan-petit:fix/jsonschema-keep-property-metadata-8453
Open

fix(jsonschema): keep property metadata on reference schemas#8480
gaetan-petit wants to merge 1 commit into
api-platform:4.3from
gaetan-petit:fix/jsonschema-keep-property-metadata-8453

Conversation

@gaetan-petit

Copy link
Copy Markdown
Contributor
Q A
Branch? 4.3
Tickets Closes #8453
License MIT

Properties typed after another class lost their description, default, example, readOnly and validator restrictions: buildPropertySchema() reset the schema on an unresolved type, then replaced it with the $ref or anyOf instead of writing into it.

The reset now drops only the unresolved-type keys, and the reference branches assign into the schema, as buildLegacyPropertySchema() already does.

AI disclosure:
Review and test were done by Claude. I reviewed and tested everything.

@gaetan-petit
gaetan-petit marked this pull request as draft August 26, 2026 12:10
@gaetan-petit
gaetan-petit force-pushed the fix/jsonschema-keep-property-metadata-8453 branch from 3ecc83a to 73d7da1 Compare August 26, 2026 12:35
@gaetan-petit
gaetan-petit marked this pull request as ready for review August 26, 2026 12:38
@gaetan-petit gaetan-petit changed the title fix(jsonschema): keep property metadata next to $ref schemas fix(jsonschema): keep property metadata on reference schemas Aug 26, 2026
@gaetan-petit
gaetan-petit marked this pull request as draft August 26, 2026 12:44
buildPropertySchema() reset the property schema on an unresolved type,
then replaced it with the `$ref` or `anyOf` instead of writing into it,
dropping `description`, `default`, `example`, `readOnly` and the
validator restrictions.

Closes api-platform#8453
@gaetan-petit
gaetan-petit force-pushed the fix/jsonschema-keep-property-metadata-8453 branch from 73d7da1 to 823533b Compare August 26, 2026 12:48
@gaetan-petit
gaetan-petit marked this pull request as ready for review August 26, 2026 12:59
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