Skip to content

Commit b3d61c8

Browse files
committed
Merge branch '5.4' into 6.0
* 5.4: fix(serializer): missing empty_array_as_object in example
2 parents 21622db + 90ff119 commit b3d61c8

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

serializer.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,10 @@ resources. This context is passed to all normalizers. For example:
103103
* :class:`Symfony\\Component\\Serializer\\Normalizer\\DateTimeNormalizer` uses
104104
``datetime_format`` key as date time format;
105105
* :class:`Symfony\\Component\\Serializer\\Normalizer\\AbstractObjectNormalizer`
106-
uses ``empty_iterable_as_object`` to represent empty objects as ``{}`` instead
106+
uses ``preserve_empty_objects`` to represent empty objects as ``{}`` instead
107+
of ``[]`` in JSON.
108+
* :class:`Symfony\\Component\\Serializer\\Serializer`
109+
uses ``empty_array_as_object`` to represent empty arrays as ``{}`` instead
107110
of ``[]`` in JSON.
108111

109112
You can pass the context as follows::

0 commit comments

Comments
 (0)