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
[Serializer] Attributes that extends the serializer`s annotations are ignored by the serialization process, while doctrine annotations processed
#43207
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Description
Classes for serialization, that are configured via Attributes, have different behavior from classes configured via doctrine annotations if these annotations||attributes are children of serializer`s annotation.
How to reproduce
F.e. I have some set of serialization groups, that I want to use many times. For it, I create a new class that extends Symfony\Component\Serializer\Annotation\Groups and set up needed groups in __construct and mark this class like DoctrineAnnotation and Attribute.
…ns are not ignored by the serialization process (Alexander Onatskiy)
This PR was merged into the 5.3 branch.
Discussion
----------
[Serializer] Attributes that extend serializer`s annotations are not ignored by the serialization process
| Q | A
| ------------- | ---
| Branch? | 5.3 for bug fixes
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fix#43207
| License | MIT
| Doc PR |
Commits
-------
3407c35 [Serializer] Attributes that extends the serializer`s annotations do not ignore by the serialization process
…ns are not ignored by the serialization process (Alexander Onatskiy)
This PR was merged into the 5.3 branch.
Discussion
----------
[Serializer] Attributes that extend serializer`s annotations are not ignored by the serialization process
| Q | A
| ------------- | ---
| Branch? | 5.3 for bug fixes
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fixsymfony/symfony#43207
| License | MIT
| Doc PR |
Commits
-------
3407c350e1 [Serializer] Attributes that extends the serializer`s annotations do not ignore by the serialization process
Symfony version(s) affected: >=5.3
Description
Classes for serialization, that are configured via Attributes, have different behavior from classes configured via doctrine annotations if these annotations||attributes are children of serializer`s annotation.
How to reproduce
F.e. I have some set of serialization groups, that I want to use many times. For it, I create a new class that extends
Symfony\Component\Serializer\Annotation\Groups
and set up needed groups in__construct
and mark this class like DoctrineAnnotation and Attribute.Next, I create 2 models with the same fields, 1st configured via the doctrine annotation, 2nd configured via attributes
And I serialize both models, expecting that results will be equals. But results are different
These happened, because AnnotationLoader ignore all attributes except the base, even if these attributes extend base
The text was updated successfully, but these errors were encountered: