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
When we don't add the #[Ignore] attribute in the TestTrait in the reproducer, everything works fine. However, adding that attribute causes all of the other properties to now be seen by the serializer and then fail because there is no public access to them via getters or via public properties.
… using the ``@Ignore`` annotation (mtarld)
This PR was merged into the 5.4 branch.
Discussion
----------
[Serializer] Fix access to private properties/getters when using the ``@Ignore`` annotation
| Q | A
| ------------- | ---
| Branch? | 5.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Issues | Fix#52673#49710
| License | MIT
Commits
-------
cc356b0 [Serializer] Fix access to private when Ignore
This PR was merged into the 5.4 branch.
Discussion
----------
[Serializer] Fix unexpected allowed attributes
| Q | A
| ------------- | ---
| Branch? | 5.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Issues | Fix#52673#49710
| License | MIT
A more accurate approach than #52680
Commits
-------
900d034 [Serializer] Fix unexpected allowed attributes
Symfony version(s) affected
6.3.8
Description
According to https://symfony.com/doc/current/components/serializer.html#ignoring-attributes all properties are included by default, which makes sense. However, this doesn't seem to be the case at least for traits and abstract classes.
When we don't add the
#[Ignore]
attribute in theTestTrait
in the reproducer, everything works fine. However, adding that attribute causes all of the other properties to now be seen by the serializer and then fail because there is no public access to them via getters or via public properties.How to reproduce
https://github.com/nesl247/symfony-serialization-ignore-bug
Possible Solution
No response
Additional Context
The text was updated successfully, but these errors were encountered: