Skip to content

Commit 822a366

Browse files
committed
bug #21574 [Serializer] Add missing json parameter (javenlalla)
This PR was merged into the 6.4 branch. Discussion ---------- [Serializer] Add missing json parameter Hello! In the `Deserializing Input Partially (Unwrapping)` section of the `Serializer` documentation, 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 Thanks! Commits ------- df65e9f [Serializer] Add missing json parameter
2 parents 65666e2 + df65e9f commit 822a366

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)