New in Symfony 4.2: Simpler custom serialized names

The Serializer component is able to transform property names when serializing
objects. For example, it can transform camel-cased properties like
$firstName into snake-cased values like first_name.

For more complex cases, you can create name converters to map PHP property
names to serialized names arbitrarily. In Symfony 4.2 we added another simpler
way to do that. You can now configure name conversion rules using metadata
and it works with PHP annotations (@SerializedName), XML config
(serialized-name attribute) and YAML config (serialized_name key).