Skip to content

Commit cc54517

Browse files
committed
fix(serializer): missing empty_array_as_object in example
1 parent 1b84e50 commit cc54517

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Diff for: serializer.rst

+5-2
Original file line numberDiff line numberDiff line change
@@ -102,12 +102,15 @@ resources. This context is passed to all normalizers. For example:
102102
* :class:`Symfony\\Component\\Serializer\\Normalizer\\DateTimeNormalizer` uses
103103
``datetime_format`` key as date time format;
104104
* :class:`Symfony\\Component\\Serializer\\Normalizer\\AbstractObjectNormalizer`
105-
uses ``empty_iterable_as_object`` to represent empty objects as ``{}`` instead
105+
uses ``preserve_empty_objects`` to represent empty objects as ``{}`` instead
106+
of ``[]`` in JSON.
107+
* :class:`Symfony\\Component\\Serializer\\Serializer`
108+
uses ``empty_array_as_object`` to represent empty arrays as ``{}`` instead
106109
of ``[]`` in JSON.
107110

108111
.. versionadded:: 5.4
109112

110-
The usage of the ``empty_array_as_object`` option by default in the
113+
The usage of the ``empty_array_as_object`` option in the
111114
Serializer was introduced in Symfony 5.4.
112115

113116
You can pass the context as follows::

0 commit comments

Comments
 (0)