Closed
Description
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 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.
How to reproduce
https://github.com/nesl247/symfony-serialization-ignore-bug
- git clone https://github.com/nesl247/symfony-serialization-ignore-bug.git
- composer install
- bin/console test:command
Possible Solution
No response
Additional Context
In PropertyAccessor.php line 456:
Can't get a way to read the property "testProperty2" in class "App\TestMessage".