Conversation
Symfony 8.0 removed the Annotation namespace class aliases (deprecated since 7.4); Groups and Context now live under Serializer\Attribute. The old import silently drops all groups (debug:serializer shows groups => []), breaking every documented denormalization example. Refs api-platform/core#8573
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes api-platform/core#8573.
The docs tell readers to import serializer attributes from
Symfony\Component\Serializer\Annotation\. Those class aliases were deprecated in Symfony 7.4 and removed in 8.0, so on a current Symfony the import is a class-not-found and the attribute never applies.The reporter hit it concretely: with the old import,
debug:serializer App\Entity\Usershowsgroups => []for every property, so the documentedPOST /api/usersflow fails validation becauseemailandplainPasswordare never denormalized.Verified against an installed
symfony/serializer8.1.6: there is noAnnotation/directory at all, onlyAttribute/.21 replacements across 6 files, every one a single import line:
core/serialization.mdGroups, 3Context)core/graphql.mdsymfony/file-upload.mdsymfony/controllers.mdsymfony/fosuser-bundle.mdsymfony/user.mdContextis included because the whole alias namespace went together;GroupsandContextare the only two classes from it that these docs reference. No prose was changed.markdownlint-cli2is clean on all six files.