Skip to content

[Serializer] By default the serializer do not convert to lower case properties #7626

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
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
15 changes: 9 additions & 6 deletions components/serializer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -511,9 +511,10 @@ There are several types of normalizers available:
directly and through getters, setters, hassers, adders and removers. It supports
calling the constructor during the denormalization process.

Objects are normalized to a map of property names (method name stripped of
the "get"/"set"/"has"/"remove" prefix and converted to lower case) to property
values.
Objects are normalized to a map of property names and values (names are
generated removing the ``get``, ``set``, ``has`` or ``remove`` prefix from
the method name and lowercasing the first letter; e.g. ``getFirstName()`` ->
``firstName``).

The ``ObjectNormalizer`` is the most powerful normalizer. It is configured by
default when using the Symfony Standard Edition with the serializer enabled.
Expand All @@ -523,8 +524,9 @@ There are several types of normalizers available:
(public methods starting with "get"). It will denormalize data by calling
the constructor and the "setters" (public methods starting with "set").

Objects are normalized to a map of property names (method name stripped of
the "get" prefix and converted to lower case) to property values.
Objects are normalized to a map of property names and values (names are
generated removing the ``get`` prefix from the method name and lowercasing
the first letter; e.g. ``getFirstName()`` -> ``firstName``).

:class:`Symfony\\Component\\Serializer\\Normalizer\\PropertyNormalizer`
This normalizer directly reads and writes public properties as well as
Expand Down Expand Up @@ -595,7 +597,8 @@ Circular references are common when dealing with entity relations::
}

To avoid infinite loops, :class:`Symfony\\Component\\Serializer\\Normalizer\\GetSetMethodNormalizer`
throws a :class:`Symfony\\Component\\Serializer\\Exception\\CircularReferenceException`
or :class:`Symfony\\Component\\Serializer\\Normalizer\\ObjectNormalizer`
throw a :class:`Symfony\\Component\\Serializer\\Exception\\CircularReferenceException`
when such a case is encountered::

$member = new Member();
Expand Down