From 89bc3260d47d52bfc6b93d3377bf290e3813fa91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Dunglas?= Date: Fri, 29 May 2015 14:42:04 +0200 Subject: [PATCH 1/3] [FrameworkBundle] Update serializer configuration reference --- cookbook/serializer.rst | 4 ++++ reference/configuration/framework.rst | 33 +++++++++++++++++++++++++-- 2 files changed, 35 insertions(+), 2 deletions(-) diff --git a/cookbook/serializer.rst b/cookbook/serializer.rst index 2e12c6cf641..93aba022a29 100644 --- a/cookbook/serializer.rst +++ b/cookbook/serializer.rst @@ -124,6 +124,8 @@ Here is an example on how to load the $definition->addTag('serializer.normalizer'); $container->setDefinition('get_set_method_normalizer', $definition); +.. _cookbook-serializer-using-serialization-groups-annotations: + Using Serialization Groups Annotations -------------------------------------- @@ -170,6 +172,8 @@ to your class and choose which groups to use when serializing:: 'json', array('groups' => array('group1') ); +.. _cookbook-serializer-enabling-metadata-cache: + Enabling the Metadata Cache --------------------------- diff --git a/reference/configuration/framework.rst b/reference/configuration/framework.rst index 0ef27c453d2..b33d5d515e1 100644 --- a/reference/configuration/framework.rst +++ b/reference/configuration/framework.rst @@ -92,7 +92,7 @@ Configuration * `validation`_ * :ref:`enabled ` * :ref:`cache ` - * `enable_annotations`_ + * :ref:`enable_annotations ` * `translation_domain`_ * `strict_email`_ * `api`_ @@ -102,6 +102,8 @@ Configuration * `debug`_ * `serializer`_ * :ref:`enabled ` + * :ref:`cache ` + * :ref:`enable_annotations ` secret ~~~~~~ @@ -1372,6 +1374,8 @@ cache The service that is used to persist class metadata in a cache. The service has to implement the :class:`Symfony\\Component\\Validator\\Mapping\\Cache\\CacheInterface`. +.. _reference-validation-enable_annotations: + enable_annotations .................. @@ -1478,7 +1482,32 @@ enabled Whether to enable the ``serializer`` service or not in the service container. -For more details, see :doc:`/cookbook/serializer`. +.. _reference-serializer-cache: + +cache +..... + +**type**: ``string`` + +The service that is used to persist class metadata in a cache. The service +has to implement the :class:`Doctrine\\Common\\Cache\\Cache` interface. + +.. seealso:: + + For more information, see :ref:`cookbook-serializer-enabling-metadata-cache`. + +.. _reference-serializer-enable_annotations: + +enable_annotations +.................. + +**type**: ``boolean`` **default**: ``false`` + +If this option is enabled, serialization groups can be defined using annotations. + +.. seealso:: + + For more information, see :ref:`cookbook-serializer-using-serialization-groups-annotations`. Full Default Configuration -------------------------- From f0c82146904b2cba7de4c3c27b4088df0f3e63cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Dunglas?= Date: Sat, 4 Jul 2015 12:20:20 +0200 Subject: [PATCH 2/3] [FrameworkBundle] Name converter of Serializer --- components/serializer.rst | 2 ++ reference/configuration/framework.rst | 14 ++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/components/serializer.rst b/components/serializer.rst index 235ce8acf58..2d8980684b4 100644 --- a/components/serializer.rst +++ b/components/serializer.rst @@ -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 ------------------------------------------------------------ diff --git a/reference/configuration/framework.rst b/reference/configuration/framework.rst index b33d5d515e1..b672484f55e 100644 --- a/reference/configuration/framework.rst +++ b/reference/configuration/framework.rst @@ -104,6 +104,7 @@ Configuration * :ref:`enabled ` * :ref:`cache ` * :ref:`enable_annotations ` + * `name_converter`_ secret ~~~~~~ @@ -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`` +value. + +.. seealso:: + + For more information, see :ref:`component-serializer-converting-property-names-when-serializing-and-deserializing`. + Full Default Configuration -------------------------- From b41660d45b0e814f157ffa5b9b39e82afa5721bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Dunglas?= Date: Tue, 6 Oct 2015 22:03:46 +0200 Subject: [PATCH 3/3] Fix @WouterJ comments --- reference/configuration/framework.rst | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/reference/configuration/framework.rst b/reference/configuration/framework.rst index b672484f55e..3d4d68fc916 100644 --- a/reference/configuration/framework.rst +++ b/reference/configuration/framework.rst @@ -1516,12 +1516,14 @@ 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`` +The :class:`Symfony\\Component\\Serializer\\NameConverter\\CamelCaseToSnakeCaseNameConverter` +name converter can enabled by using the ``serializer.name_converter.camel_case_to_snake_case`` value. .. seealso:: - For more information, see :ref:`component-serializer-converting-property-names-when-serializing-and-deserializing`. + For more information, see + :ref:`component-serializer-converting-property-names-when-serializing-and-deserializing`. Full Default Configuration --------------------------