Skip to content

[Serializer] versionadded directive for name_converter option #6992

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

Merged
merged 1 commit into from
Sep 24, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
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
8 changes: 5 additions & 3 deletions reference/configuration/framework.rst
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ Configuration
* :ref:`enabled <reference-serializer-enabled>`
* :ref:`cache <reference-serializer-cache>`
* :ref:`enable_annotations <reference-serializer-enable_annotations>`
* `name_converter`_
* :ref:`name_converter <reference-serializer-name_converter>`

secret
~~~~~~
Expand Down Expand Up @@ -1497,14 +1497,16 @@ If this option is enabled, serialization groups can be defined using annotations

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

.. _reference-serializer-name_converter:

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

**type**: ``string``

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

Choose a reason for hiding this comment

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

The xxx setting was introduced ... is used 3 times in Symfony Docs, but The xxx option was introduced... alternative is used tens of times. Let's normalize that in a separate PR.

Copy link
Member Author

Choose a reason for hiding this comment

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

see #7007


**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``
Expand Down
7 changes: 5 additions & 2 deletions serializer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -241,9 +241,12 @@ A service leveraging `APCu`_ (and APC for PHP < 5.5) is built-in.
Enabling a Name Converter
-------------------------

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

The use of a :ref:`name converter <component-serializer-converting-property-names-when-serializing-and-deserializing>`
service can be defined in the configuration using the ``name_converter``
serializer parameter.
service can be defined in the configuration using the :ref:`name_converter <reference-serializer-name_converter>`
option.

The built-in :ref:`CamelCase to snake_case name converter <using-camelized-method-names-for-underscored-attributes>`
can be enabled by using the ``serializer.name_converter.camel_case_to_snake_case``
Expand Down