From d1cd14f14bc9860e7ffaccedb6c55e013bfd106e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Pineau?= Date: Tue, 14 Mar 2017 17:06:16 +0100 Subject: [PATCH 1/3] [Serializer] By default the serializer do not convert to lower case properties --- components/serializer.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/serializer.rst b/components/serializer.rst index 12c594a4eca..d16cec6cc9a 100644 --- a/components/serializer.rst +++ b/components/serializer.rst @@ -512,7 +512,7 @@ There are several types of normalizers available: 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 + the "get"/"set"/"has"/"remove" prefix) to property values. The ``ObjectNormalizer`` is the most powerful normalizer. It is configured by @@ -524,7 +524,7 @@ There are several types of normalizers available: 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. + the "get" prefix) to property values. :class:`Symfony\\Component\\Serializer\\Normalizer\\PropertyNormalizer` This normalizer directly reads and writes public properties as well as From 3af050c61c5fda1313cdd178f12216d8083aed2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Pineau?= Date: Tue, 14 Mar 2017 17:19:46 +0100 Subject: [PATCH 2/3] [Serializer] Added missing ObjectNormalizer --- components/serializer.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/components/serializer.rst b/components/serializer.rst index d16cec6cc9a..b3b5a9d6a57 100644 --- a/components/serializer.rst +++ b/components/serializer.rst @@ -595,7 +595,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(); From 364629f3692960673b084e63a762ba934a87c490 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Sat, 10 Feb 2018 16:53:44 +0100 Subject: [PATCH 3/3] Minor reword --- components/serializer.rst | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/components/serializer.rst b/components/serializer.rst index b3b5a9d6a57..ea6d07f42ad 100644 --- a/components/serializer.rst +++ b/components/serializer.rst @@ -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) 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. @@ -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) 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