Open
Description
Symfony version(s) affected
6.2.2
Description
When CamelCaseToSnakeCaseNameConverter
is enabled, both snake_case
keys and camelCase
keys in array are denormalized to public camelCase
properties.
OTOH when the class has a constructor, only snake_case
keys are denormalized into constructor parameters, camelCase
array keys cause the object construction to fail (serializer is unable to map camelCase
key from array to camelCase
constructor parameter). This is inconsistent with denormalization without constructor.
How to reproduce
Here is the reproducer, checkout the repo and run test cases. 4th test case is exactly like the second test case with the difference of constructor and it fails.
https://github.com/faizanakram99/serializer-bug-reproducer
Possible Solution
No response
Additional Context
No response