Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions serializer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1571,6 +1571,13 @@ to ``true``::
]);
// $jsonContent contains {"name":"Jane Doe"}

Preserving Empty Objetcs
~~~~~~~~~~~~~~~~~~~~~~~~

By default, the Serializer will transform an empty array to `[]`.
You can change this behavior by setting the ``AbstractObjectNormalizer::PRESERVE_EMPTY_OBJECTS`` context option
to ``true``, when the value is `\ArrayObject()` the serialization would be `{}`.

Handling Uninitialized Properties
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expand Down