Skip to content

fix(metadata): keep explicit readableLink and writableLink on collections of non-resource classes - #8706

Merged
soyuka merged 1 commit into
api-platform:5.0from
Maxcastel:fix/serializer-property-links-on-non-resource-collections
Oct 16, 2026
Merged

soyuka merged 1 commit into
api-platform:5.0from
Maxcastel:fix/serializer-property-links-on-non-resource-collections

Conversation

@Maxcastel

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

In an output DTO, a collection of resources was always embedded:

/** @var Book[] */
#[ApiProperty(readableLink: false, writableLink: false)]
public array $books = [];

For non-resource classes the factory forced both links to true. It's now only the default, an explicit value is kept like for resources.

@soyuka
soyuka merged commit 996c37a into api-platform:5.0 Oct 16, 2026
109 of 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.

2 participants