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
To solve issue we need to switch GetSetNormalizer with ObjectNormalizer:
$classMetadataFactory = new ClassMetadataFactory(new AnnotationLoader(new AnnotationReader()));
$encoders = [new XmlEncoder(), new JsonEncoder()];
$normalizers = [
new DateTimeNormalizer(),
- new GetSetMethodNormalizer($classMetadataFactory, null, new PhpDocExtractor()),
new ObjectNormalizer(
$classMetadataFactory,
null,
null,
new PhpDocExtractor()
),
+ new GetSetMethodNormalizer($classMetadataFactory, null, new PhpDocExtractor()),
new ArrayDenormalizer(),
];
$serializer = new Serializer($normalizers, $encoders);
Additional Context
No response
The text was updated successfully, but these errors were encountered:
Object deserialization ends up in data lose. Solution worked in all previous versions of symfony/serializer before 5.4.39.
This conclusion doesn't look right to me. The commit that was reverted in #54635 has been introduced in 5.4.38 which means that your example couldn't have worked in 5.4.37.
With that being said, can it be that the issue your experience is caused by another change? Can you explain a bit more how the bug manifests (i.e. what behaviour do you observe and what did you expect instead)?
Symfony version(s) affected
5.4.39
Description
Object deserialization ends up in data lose. Solution worked in all previous versions of symfony/serializer before 5.4.39.
How to reproduce
We need object with reference to list of other objects eg. Room with Participant[].
Serializer configuration:
Possible Solution
To solve issue we need to switch GetSetNormalizer with ObjectNormalizer:
Additional Context
No response
The text was updated successfully, but these errors were encountered: