Skip to content

fix(jsonschema): respect readableLink for resource-typed properties on non-resource parents#8362

Merged
soyuka merged 1 commit into
api-platform:4.3from
wuchen90:fix-schema-property-metadata-factory
Jun 29, 2026
Merged

fix(jsonschema): respect readableLink for resource-typed properties on non-resource parents#8362
soyuka merged 1 commit into
api-platform:4.3from
wuchen90:fix-schema-property-metadata-factory

Conversation

@wuchen90

Copy link
Copy Markdown
Contributor
Q A
Branch? 4.3
License MIT

When a non-resource class B holds a property of resource type A (e.g. A → B[] → A), the circular reference handler in AbstractItemNormalizer converts the property to an IRI at runtime. The previous heuristic unconditionally forced $link=true (embedded schema) for all properties of non-resource containing classes, causing the OpenAPI spec to show an embedded object instead of an iri-reference string.

Now, for resource-typed properties on non-resource parents, isReadableLink determines the schema (matching the circular reference handler behaviour). Non-resource-typed properties on non-resource parents are unchanged.

…n non-resource parents

When a non-resource class B holds a property of resource type A (e.g. A → B[] → A),
the circular reference handler in AbstractItemNormalizer converts the property to an IRI
at runtime. The previous heuristic unconditionally forced $link=true (embedded schema)
for all properties of non-resource containing classes, causing the OpenAPI spec to show
an embedded object instead of an iri-reference string.

Now, for resource-typed properties on non-resource parents, isReadableLink determines
the schema (matching the circular reference handler behaviour). Non-resource-typed
properties on non-resource parents are unchanged.
@wuchen90 wuchen90 force-pushed the fix-schema-property-metadata-factory branch from 1b461ca to 638d465 Compare June 29, 2026 10:01
@soyuka soyuka merged commit 71918e4 into api-platform:4.3 Jun 29, 2026
109 of 112 checks passed
@soyuka

soyuka commented Jun 29, 2026

Copy link
Copy Markdown
Member

thanks!

@wuchen90 wuchen90 deleted the fix-schema-property-metadata-factory branch June 29, 2026 14:46
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.

2 participants