I'm using FOS Rest bundle and JMS Serializer to create a REST Api. The problem is I would like to keep the property names in the JSON response camel cased instead of using _.
For example, I have a property called employeeIdentifier, by default that gets converted to employee_identifier.
I saw that there's an option in the config to disable the lowercase and get rid of the _, but then it becomes EmployeeIdentifier.
Is there any way that JMS Serializer keeps the original name of the property? Thanks in advance
Worked for me (Symfony 4.4 and JMS ^3.8) with this config in config/packages/jms_serializer.yaml
:
jms_serializer:
property_naming:
id: jms_serializer.identical_property_naming_strategy
and removing the cache manually
https://github.com/schmittjoh/serializer/issues/1037
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With