File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -1176,15 +1176,15 @@ to ``true``::
1176
1176
1177
1177
.. _component-serializer-handling-circular-references :
1178
1178
1179
- Collecting type errors while denormalizing
1179
+ Collecting Type Errors While Denormalizing
1180
1180
------------------------------------------
1181
1181
1182
- When denormalizing a payload to an object with type hints, if the payload
1183
- contains a property that doesn 't have the same type as the object, an exception
1184
- is thrown .
1182
+ When denormalizing a payload to an object with typed properties, you'll get an
1183
+ exception if the payload contains properties that don 't have the same type as
1184
+ the object .
1185
1185
1186
- It's possible to collect all exceptions at once, and to get the object partially
1187
- denormalized::
1186
+ In those situations, use the `` COLLECT_DENORMALIZATION_ERRORS `` option to
1187
+ collect all exceptions at once, and to get the object partially denormalized::
1188
1188
1189
1189
try {
1190
1190
$dto = $serializer->deserialize($request->getContent(), MyDto::class, 'json', [
@@ -1205,6 +1205,10 @@ denormalized::
1205
1205
return $this->json($violations, 400);
1206
1206
}
1207
1207
1208
+ .. versionadded :: 5.4
1209
+
1210
+ The ``COLLECT_DENORMALIZATION_ERRORS `` option was introduced in Symfony 5.4.
1211
+
1208
1212
Handling Circular References
1209
1213
----------------------------
1210
1214
You can’t perform that action at this time.
0 commit comments