Skip to content

Commit df65e9f

Browse files
authored
[Serializer] Add missing json parameter
In the `Deserializing Input Partially (Unwrapping)` section, the code sample is missing the `'json'` format specifier as the third argument when calling `deserialize`. This commit adds the missing format value into the function call of the code sample. Function signature: https://github.com/symfony/symfony/blob/6.4/src/Symfony/Component/Serializer/Serializer.php#L146 Page: https://symfony.com/doc/6.4/serializer.html#deserializing-input-partially-unwrapping
1 parent 65666e2 commit df65e9f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

serializer.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2097,7 +2097,7 @@ To avoid deserializing the whole response, you can use the
20972097
and "unwrap" the input data::
20982098

20992099
$jsonData = '{"result":"success","data":{"person":{"name": "Jane Doe","age":57}}}';
2100-
$data = $serialiser->deserialize($jsonData, Object::class, [
2100+
$data = $serialiser->deserialize($jsonData, Object::class, 'json', [
21012101
UnwrappingDenormalizer::UNWRAP_PATH => '[data][person]',
21022102
]);
21032103
// $data is Person(name: 'Jane Doe', age: 57)

0 commit comments

Comments
 (0)