From 49239d969d25c25a6945aa297d89d423624998f9 Mon Sep 17 00:00:00 2001 From: Pierre-Jean Leger Date: Sat, 7 Mar 2020 10:37:29 +0100 Subject: [PATCH] Missing format parameter in a serialize call --- components/serializer.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/serializer.rst b/components/serializer.rst index 5f150a212b3..e7ed6f12550 100644 --- a/components/serializer.rst +++ b/components/serializer.rst @@ -625,7 +625,7 @@ defines a ``Person`` entity with a ``firstName`` property: This custom mapping is used to convert property names when serializing and deserializing objects:: - $serialized = $serializer->serialize(new Person("Kévin")); + $serialized = $serializer->serialize(new Person("Kévin"), 'json'); // {"customer_name": "Kévin"} Serializing Boolean Attributes @@ -1450,7 +1450,7 @@ and ``BitBucketCodeRepository`` classes: Once configured, the serializer uses the mapping to pick the correct class:: - $serialized = $serializer->serialize(new GitHubCodeRepository()); + $serialized = $serializer->serialize(new GitHubCodeRepository(), 'json'); // {"type": "github"} $repository = $serializer->deserialize($serialized, CodeRepository::class, 'json');