Skip to content

Commit f488012

Browse files
committed
minor #19526 [Serializer] Add Default and "class name" default groups (alexandre-daubois)
This PR was merged into the 7.1 branch. Discussion ---------- [Serializer] Add `Default` and "class name" default groups Fix #19493 Commits ------- 4085aed [Serializer] Add Default and "class name" default groups
2 parents add92fa + 4085aed commit f488012

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

serializer.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -383,6 +383,18 @@ stored in one of the following locations:
383383
* All ``*.yaml`` and ``*.xml`` files in the ``Resources/config/serialization/``
384384
directory of a bundle.
385385

386+
.. note::
387+
388+
By default, the ``Default`` group is used when normalizing and denormalizing
389+
objects. A group corresponding to the class name is also used. For example,
390+
if you are normalizing a ``App\Entity\Product`` object, the ``Product`` group
391+
is also included by default.
392+
393+
.. versionadded:: 7.1
394+
395+
The default use of the class name and ``Default`` groups when normalizing
396+
and denormalizing objects was introduced in Symfony 7.1.
397+
386398
.. _serializer-enabling-metadata-cache:
387399

388400
Using Nested Attributes

0 commit comments

Comments
 (0)