From 3781df649e39522eddbb612d452c661eb33f33d1 Mon Sep 17 00:00:00 2001 From: Guilhem Niot Date: Fri, 12 Jun 2020 13:46:50 +0200 Subject: [PATCH] [PropertyInfo] Document setting serializer_groups to null in the SerializerExtractor --- components/property_info.rst | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/components/property_info.rst b/components/property_info.rst index d67034b04fa..16aac3299e2 100644 --- a/components/property_info.rst +++ b/components/property_info.rst @@ -435,7 +435,18 @@ with the ``property_info`` service in the Symfony Framework:: $serializerExtractor = new SerializerExtractor($serializerClassMetadataFactory); // List information. - $serializerExtractor->getProperties($class); + $serializerExtractor->getProperties($class, ['serializer_groups' => ['mygroup']]); + +.. note:: + + The ``serializer_groups`` option must be provided in order to have a value different than ``null`` returned. + + If ``serializer_groups`` is set to ``null``, serializer groups metadata won't be checked but you will get only the properties + considered by the Serializer Component (notably the ``@Ignore`` annotation is taken into account). + +.. versionadded:: 5.2 + + Support for the ``null`` value in ``serializer_groups`` was introduced in Symfony 5.2. DoctrineExtractor ~~~~~~~~~~~~~~~~~