Skip to content

fix(jsonapi): use parent-resolved class in denormalizeRelation#7938

Merged
soyuka merged 2 commits intoapi-platform:4.3from
elfin-sbreuers:fix_converting_collections_fails
Apr 30, 2026
Merged

fix(jsonapi): use parent-resolved class in denormalizeRelation#7938
soyuka merged 2 commits intoapi-platform:4.3from
elfin-sbreuers:fix_converting_collections_fails

Conversation

@elfin-sbreuers
Copy link
Copy Markdown
Contributor

This fix aims at avoiding the

Uncaught PHP Exception ApiPlatform\Metadata\Exception\OperationNotFoundException: "Operation "" not found for resource "Collection"." at ResourceMetadataCollection.php line 114

when using JSONAPI with

api_platform:
   jsonapi:
        use_iri_as_id: false

Happens in version 4.3.

The reason is that the implemented algorithm does not resolve to the class inside of the container. The third parameter seems already to provide the actual target class.

@soyuka
Copy link
Copy Markdown
Member

soyuka commented Apr 29, 2026

failure is related

@elfin-sbreuers elfin-sbreuers force-pushed the fix_converting_collections_fails branch from d052b8c to 8f77afe Compare April 30, 2026 07:05
@elfin-sbreuers
Copy link
Copy Markdown
Contributor Author

@soyuka Thanks for the hint. Fixed it. Sorry for the additional loop.

@soyuka soyuka force-pushed the fix_converting_collections_fails branch from 78e7c45 to 155ecb9 Compare April 30, 2026 09:07
@soyuka soyuka changed the title fix: converting collections breaks since it does not resolve to eleme… fix(jsonapi): use parent-resolved class in denormalizeRelation Apr 30, 2026
@soyuka soyuka merged commit 967ff79 into api-platform:4.3 Apr 30, 2026
117 of 119 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