Skip to content

Commit 1bb1a68

Browse files
committed
minor symfony#7626 [Serializer] By default the serializer do not convert to lower case properties (lyrixx, javiereguiluz)
This PR was submitted for the 2.8 branch but it was merged into the 2.7 branch instead (closes symfony#7626). Discussion ---------- [Serializer] By default the serializer do not convert to lower case properties Commits ------- 16cad92 Minor reword b384cc2 [Serializer] Added missing ObjectNormalizer f7ebf56 [Serializer] By default the serializer do not convert to lower case properties
2 parents a23bbdb + 16cad92 commit 1bb1a68

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

components/serializer.rst

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -510,9 +510,10 @@ There are several types of normalizers available:
510510
directly and through getters, setters, hassers, adders and removers. It supports
511511
calling the constructor during the denormalization process.
512512

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

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

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

528530
:class:`Symfony\\Component\\Serializer\\Normalizer\\PropertyNormalizer`
529531
This normalizer directly reads and writes public properties as well as
@@ -602,7 +604,8 @@ Circular references are common when dealing with entity relations::
602604
}
603605

604606
To avoid infinite loops, :class:`Symfony\\Component\\Serializer\\Normalizer\\GetSetMethodNormalizer`
605-
throws a :class:`Symfony\\Component\\Serializer\\Exception\\CircularReferenceException`
607+
or :class:`Symfony\\Component\\Serializer\\Normalizer\\ObjectNormalizer`
608+
throw a :class:`Symfony\\Component\\Serializer\\Exception\\CircularReferenceException`
606609
when such a case is encountered::
607610

608611
$member = new Member();

0 commit comments

Comments
 (0)