8000 [FrameworkBundle] Name converter of Serializer by dunglas · Pull Request #5483 · symfony/symfony-docs · GitHub
[go: up one dir, main page]

Skip to content

[FrameworkBundle] Name converter of Serializer #5483

8000
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[FrameworkBundle] Name converter of Serializer
  • Loading branch information
dunglas committed Jul 4, 2015
commit f0c82146904b2cba7de4c3c27b4088df0f3e63cc
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
14 changes: 14 additions & 0 deletions reference/configuration/framework.rst < 8000 span data-view-component="true">
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 @@ -1509,6 +1510,19 @@ 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
..............

**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``
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this line has to be broken after the first word that crosses the 72th character

value.

.. seealso::

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here (the ref should be placed on its own line). I would also prefer if the ref pointer can be a little bit smaller.


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

Expand Down
0