Skip to content

Commit f0c8214

Browse files
committed
[FrameworkBundle] Name converter of Serializer
1 parent 89bc326 commit f0c8214

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

components/serializer.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,8 @@ method on the normalizer definition::
344344
$serializer = new Serializer(array($normalizer), array($encoder));
345345
$serializer->serialize($person, 'json'); // Output: {"name":"foo","sportsman":false}
346346

347+
.. _component-serializer-converting-property-names-when-serializing-and-deserializing:
348+
347349
Converting Property Names when Serializing and Deserializing
348350
------------------------------------------------------------
349351

reference/configuration/framework.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ Configuration
104104
* :ref:`enabled <reference-serializer-enabled>`
105105
* :ref:`cache <reference-serializer-cache>`
106106
* :ref:`enable_annotations <reference-serializer-enable_annotations>`
107+
* `name_converter`_
107108

108109
secret
109110
~~~~~~
@@ -1509,6 +1510,19 @@ If this option is enabled, serialization groups can be defined using annotations
15091510

15101511
For more information, see :ref:`cookbook-serializer-using-serialization-groups-annotations`.
15111512

1513+
name_converter
1514+
..............
1515+
1516+
**type**: ``string``
1517+
1518+
The name converter to use.
1519+
The :class:`Symfony\\Component\\Serializer\\NameConverter\\CamelCaseToSnakeCaseNameConverter` name converter can enabled by using the ``serializer.name_converter.camel_case_to_snake_case``
1520+
value.
1521+
1522+
.. seealso::
1523+
1524+
For more information, see :ref:`component-serializer-converting-property-names-when-serializing-and-deserializing`.
1525+
15121526
Full Default Configuration
15131527
--------------------------
15141528

0 commit comments

Comments
 (0)