We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ccd1137 commit ce28629Copy full SHA for ce28629
serializer.rst
@@ -1571,6 +1571,13 @@ to ``true``::
1571
]);
1572
// $jsonContent contains {"name":"Jane Doe"}
1573
1574
+Preserving Empty Objetcs
1575
+~~~~~~~~~~~~~~~~~~~~~~~~
1576
+
1577
+By default, the Serializer will transform an empty array to `[]`.
1578
+You can change this behavior by setting the ``AbstractObjectNormalizer::PRESERVE_EMPTY_OBJECTS`` context option
1579
+to ``true``, when the value is `\ArrayObject()` the serialization would be `{}`.
1580
1581
Handling Uninitialized Properties
1582
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1583
0 commit comments