From df65e9f4a3d45c9063f47d70f197b77f8135d1ef Mon Sep 17 00:00:00 2001 From: javenlalla Date: Thu, 13 Nov 2025 11:12:50 +0100 Subject: [PATCH] [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 --- serializer.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/serializer.rst b/serializer.rst index b30b5caf2e2..fbda5b6a093 100644 --- a/serializer.rst +++ b/serializer.rst @@ -2097,7 +2097,7 @@ To avoid deserializing the whole response, you can use the and "unwrap" the input data:: $jsonData = '{"result":"success","data":{"person":{"name": "Jane Doe","age":57}}}'; - $data = $serialiser->deserialize($jsonData, Object::class, [ + $data = $serialiser->deserialize($jsonData, Object::class, 'json', [ UnwrappingDenormalizer::UNWRAP_PATH => '[data][person]', ]); // $data is Person(name: 'Jane Doe', age: 57)