Skip to content

Commit

Permalink
feature #5483 [FrameworkBundle] Name converter of Serializer (dunglas)
Browse files Browse the repository at this point in the history
This PR was squashed before being merged into the 2.8 branch (closes #5483).

Discussion
----------

[FrameworkBundle] Name converter of Serializer

| Q             | A
| ------------- | ---
| Doc fix?      | no
| New docs?     | yes symfony/symfony#14987
| Applies to    | 2.8
| Fixed tickets | n/a

Commits
-------

7a4d9fc [FrameworkBundle] Name converter of Serializer
  • Loading branch information
wouterj committed Feb 6, 2016
2 parents e821b97 + 7a4d9fc commit 41d43dd
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
2 changes: 2 additions & 0 deletions components/serializer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,8 @@ method on the normalizer definition::
$serializer = new Serializer(array($normalizer), array($encoder));
$serializer->serialize($person, 'json'); // Output: {"name":"foo","sportsman":false}

.. _component-serializer-converting-property-names-when-serializing-and-deserializing:

Converting Property Names when Serializing and Deserializing
------------------------------------------------------------

Expand Down
19 changes: 19 additions & 0 deletions reference/configuration/framework.rst
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ Configuration
* :ref:`enabled <reference-serializer-enabled>`
* :ref:`cache <reference-serializer-cache>`
* :ref:`enable_annotations <reference-serializer-enable_annotations>`
* `name_converter`_

secret
~~~~~~
Expand Down Expand Up @@ -1505,6 +1506,24 @@ If this option is enabled, serialization groups can be defined using annotations

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

name_converter
..............

.. versionadded:: 2.8
The ``name_converter`` setting was introduced in Symfony 2.8.

**type**: ``string``

The name converter to use.
The :class:`Symfony\\Component\\Serializer\\NameConverter\\CamelCaseToSnakeCaseNameConverter`
name converter can enabled by using the ``serializer.name_converter.camel_case_to_snake_case``
value.

.. seealso::

For more information, see
:ref:`component-serializer-converting-property-names-when-serializing-and-deserializing`.

Full Default Configuration
--------------------------

Expand Down

0 comments on commit 41d43dd

Please sign in to comment.