You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
denormalizers are no longer aliased as normalizer in 4.4 #8550
Given this setup, I expect normalize to add extraProperty and denormalize to set test to true. In 4.3 this worked, in 4.4 it no longer works and we have to add an extra decorator:
The split gave every format a denormalizer whose priority sits one above its normalizer, so the serializer reaches it first and the decorated service is never asked to denormalize:
format
normalizer
denormalizer (4.4)
jsonld
-890
-889
jsonapi
-890
-889
serializer, the one the documentation uses most
-895
-894
What makes it quiet is that ItemNormalizer still implements denormalize() and supportsDenormalization() in 4.4, so a decorator of the old service is neither wrong nor broken, just shadowed. Nothing fails, the data simply comes back undecorated.
ItemDenormalizer::supportsDenormalization() only adds the format check on top of the parent, so it answers for exactly what the old service used to answer for.
Happy to send the documentation update once you have picked a direction, since the page still tells people to decorate the normalizer for both. The direction itself is yours: swapping the two priorities restores the old behaviour but makes the new class unreachable whenever the normalizer also supports the type, so the alternative is to keep it and say in UPGRADE that a decorator now has to cover both services.
The split in #7713 is intentional: since 4.4, denormalization goes through a dedicated ItemDenormalizer service (api_platform.jsonld.denormalizer.item, and the matching ids for JSON:API and the generic serializer), which runs before the normalizer. We do not plan to swap the priorities back, because that would make the new denormalizers unreachable.
To change denormalization, decorate the denormalizer service. To change both directions, decorate both services:
You are right that the serialization docs still show one decorator for both directions. That page needs an update for 4.4, and a docs PR is welcome (@Amoifr offered one). Closing, because the behaviour is by design.
But @soyuka this is a pretty big backwards compatibility break. Decorating the normalizer is per-documentation the way users used to add custom denormalization logic. This is now suddenly broken on a minor version update and thus does not belong in 4.4. It should be pushed to 5.0.
Reopening: my earlier close was wrong. The documentation told users to decorate the item normalizer for both directions, and that stopped working in 4.4 without any warning. That is a BC break in a minor version.
#8606 adds a BC layer for 4.4. When a service decorates api_platform.*.normalizer.item and implements DenormalizerInterface, denormalization goes through that decorator again, as in 4.3, and a deprecation asks you to decorate api_platform.*.denormalizer.item instead. The layer stays until 6.0.
Activity
jannes-io commentedon Sep 21, 2026
Current workaround:
Downgrading all installed api-platform packages from
^4.3to4.3.*temporarily:(note: your installed api-platform packages may vary, this is for a orm + elasticsearch + symfony project)
Amoifr commentedon Sep 22, 2026
Confirmed, and it reaches further than JSON-LD.
The split gave every format a denormalizer whose priority sits one above its normalizer, so the serializer reaches it first and the decorated service is never asked to denormalize:
jsonldjsonapiserializer, the one the documentation uses mostWhat makes it quiet is that
ItemNormalizerstill implementsdenormalize()andsupportsDenormalization()in 4.4, so a decorator of the old service is neither wrong nor broken, just shadowed. Nothing fails, the data simply comes back undecorated.ItemDenormalizer::supportsDenormalization()only adds the format check on top of the parent, so it answers for exactly what the old service used to answer for.Happy to send the documentation update once you have picked a direction, since the page still tells people to decorate the normalizer for both. The direction itself is yours: swapping the two priorities restores the old behaviour but makes the new class unreachable whenever the normalizer also supports the type, so the alternative is to keep it and say in UPGRADE that a decorator now has to cover both services.
jannes-io commentedon Sep 22, 2026
This needs @soyuka or a maintainer’s decision.
soyuka commentedon Sep 29, 2026
The split in #7713 is intentional: since 4.4, denormalization goes through a dedicated
ItemDenormalizerservice (api_platform.jsonld.denormalizer.item, and the matching ids for JSON:API and the generic serializer), which runs before the normalizer. We do not plan to swap the priorities back, because that would make the new denormalizers unreachable.To change denormalization, decorate the denormalizer service. To change both directions, decorate both services:
You are right that the serialization docs still show one decorator for both directions. That page needs an update for 4.4, and a docs PR is welcome (@Amoifr offered one). Closing, because the behaviour is by design.
jannes-io commentedon Sep 29, 2026
But @soyuka this is a pretty big backwards compatibility break. Decorating the normalizer is per-documentation the way users used to add custom denormalization logic. This is now suddenly broken on a minor version update and thus does not belong in 4.4. It should be pushed to 5.0.
Why was this part of 4.4?
soyuka commentedon Sep 29, 2026
Reopening: my earlier close was wrong. The documentation told users to decorate the item normalizer for both directions, and that stopped working in 4.4 without any warning. That is a BC break in a minor version.
#8606 adds a BC layer for 4.4. When a service decorates
api_platform.*.normalizer.itemand implementsDenormalizerInterface, denormalization goes through that decorator again, as in 4.3, and a deprecation asks you to decorateapi_platform.*.denormalizer.iteminstead. The layer stays until 6.0.fix(symfony): keep denormalize on decorated normalizers (#8606)
jannes-io commentedon Oct 2, 2026
@soyuka is there a timing on the release for this fix?