Skip to content

Commit 73695a2

Browse files
committed
minor #13825 [PropertyInfo] Document setting serializer_groups to null in the SerializerExtractor (GuilhemN)
This PR was submitted for the master branch but it was squashed and merged into the 5.x branch instead. Discussion ---------- [PropertyInfo] Document setting serializer_groups to null in the SerializerExtractor This PR fixes #13793 :) If you'd like I can backport the part about `serializer_groups` begin mandatory in order to use the `SerializerExtractor`. Commits ------- 3781df6 [PropertyInfo] Document setting serializer_groups to null in the SerializerExtractor
2 parents 5f82d44 + 3781df6 commit 73695a2

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

components/property_info.rst

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,18 @@ with the ``property_info`` service in the Symfony Framework::
435435
$serializerExtractor = new SerializerExtractor($serializerClassMetadataFactory);
436436

437437
// List information.
438-
$serializerExtractor->getProperties($class);
438+
$serializerExtractor->getProperties($class, ['serializer_groups' => ['mygroup']]);
439+
440+
.. note::
441+
442+
The ``serializer_groups`` option must be provided in order to have a value different than ``null`` returned.
443+
444+
If ``serializer_groups`` is set to ``null``, serializer groups metadata won't be checked but you will get only the properties
445+
considered by the Serializer Component (notably the ``@Ignore`` annotation is taken into account).
446+
447+
.. versionadded:: 5.2
448+
449+
Support for the ``null`` value in ``serializer_groups`` was introduced in Symfony 5.2.
439450

440451
DoctrineExtractor
441452
~~~~~~~~~~~~~~~~~

0 commit comments

Comments
 (0)