Skip to content

Commit 49239d9

Browse files
committed
Missing format parameter in a serialize call
1 parent 9d624c6 commit 49239d9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

components/serializer.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -625,7 +625,7 @@ defines a ``Person`` entity with a ``firstName`` property:
625625
This custom mapping is used to convert property names when serializing and
626626
deserializing objects::
627627

628-
$serialized = $serializer->serialize(new Person("Kévin"));
628+
$serialized = $serializer->serialize(new Person("Kévin"), 'json');
629629
// {"customer_name": "Kévin"}
630630

631631
Serializing Boolean Attributes
@@ -1450,7 +1450,7 @@ and ``BitBucketCodeRepository`` classes:
14501450
14511451
Once configured, the serializer uses the mapping to pick the correct class::
14521452

1453-
$serialized = $serializer->serialize(new GitHubCodeRepository());
1453+
$serialized = $serializer->serialize(new GitHubCodeRepository(), 'json');
14541454
// {"type": "github"}
14551455

14561456
$repository = $serializer->deserialize($serialized, CodeRepository::class, 'json');

0 commit comments

Comments
 (0)