If your object contains nested objects, an ``ExtraAttributesException`` will be thrown at first nested object containing
201
+
extra attributes. When this happens, you can use :ref:`Attributes Groups section <component-serializer-collecting-extra-attributes-errors-while-denormalizing>`
202
+
198
203
Deserializing in an Existing Object
199
204
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
200
205
@@ -1266,8 +1271,8 @@ Collecting Type Errors While Denormalizing
1266
1271
------------------------------------------
1267
1272
1268
1273
When denormalizing a payload to an object with typed properties, you'll get an
1269
-
exception if the payload contains properties that don't have the same type as
1270
-
the object.
1274
+
exception ``NotNormalizableValueException`` if the payload contains properties that don't have the same type as
1275
+
the object, at first incorrect type.
1271
1276
1272
1277
In those situations, use the ``COLLECT_DENORMALIZATION_ERRORS`` option to
1273
1278
collect all exceptions at once, and to get the object partially denormalized::
@@ -1291,6 +1296,34 @@ collect all exceptions at once, and to get the object partially denormalized::
1291
1296
return $this->json($violations, 400);
1292
1297
}
1293
1298
1299
+
Collecting Extra Attributes Errors While Denormalizing
1300
+
------------------------------------------
1301
+
1302
+
When denormalizing a payload with ``ALLOW_EXTRA_ATTRIBUTES`` set to false to an object with nested objects, you'll get an
1303
+
exception at first ``ExtraAttributesException`` in nested objects.
1304
+
1305
+
In those situations, use the ``COLLECT_EXTRA_ATTRIBUTES_ERRORS`` option to
1306
+
collect all exceptions at once, and to get the object partially denormalized::
0 commit comments