Skip to content

Commit 889cbd6

Browse files
committed
Minor reword
1 parent e3dff17 commit 889cbd6

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

serializer.rst

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -148,18 +148,22 @@ properties and setters (``setXxx()``) to change properties:
148148
;
149149
};
150150
151-
Serializer context
151+
Serializer Context
152152
------------------
153153

154-
The serializer can use a (de)serialization context to control how a resource is (de)serialized.
155-
The context is passed to all normalizers. For example:
154+
The serializer can define a context to control how the (de)serialization of
155+
resources. This context is passed to all normalizers. For example:
156156

157-
* :class:`Symfony\\Component\\Serializer\\Normalizer\\DateTimeNormalizer` uses ``datetime_format`` key as date time format;
158-
* :class:`Symfony\\Component\\Serializer\\Normalizer\\AbstractObjectNormalizer` uses ``empty_iterable_as_object`` to preserve empty objects (keeps ``{}`` instead of ``[]`` in JSON);
157+
* :class:`Symfony\\Component\\Serializer\\Normalizer\\DateTimeNormalizer` uses
158+
``datetime_format`` key as date time format;
159+
* :class:`Symfony\\Component\\Serializer\\Normalizer\\AbstractObjectNormalizer`
160+
uses ``empty_iterable_as_object`` to represent empty objects as ``{}`` instead
161+
of ``[]`` in JSON.
159162

160163
.. versionadded:: 5.4
161164

162-
:class:`Symfony\\Component\\Serializer\\Serializer` uses ``empty_arrays_as_object`` to serialize empty array as object (uses ``{}`` instead of ``[]`` in JSON);
165+
The usage of the ``empty_arrays_as_object`` option by default in the
166+
Serializer was introduced in Symfony 5.4.
163167

164168
You can pass the context like following::
165169

0 commit comments

Comments
 (0)