File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -625,7 +625,7 @@ defines a ``Person`` entity with a ``firstName`` property:
625
625
This custom mapping is used to convert property names when serializing and
626
626
deserializing objects::
627
627
628
- $serialized = $serializer->serialize(new Person("Kévin"));
628
+ $serialized = $serializer->serialize(new Person("Kévin"), 'json' );
629
629
// {"customer_name": "Kévin"}
630
630
631
631
Serializing Boolean Attributes
@@ -1450,7 +1450,7 @@ and ``BitBucketCodeRepository`` classes:
1450
1450
1451
1451
Once configured, the serializer uses the mapping to pick the correct class::
1452
1452
1453
- $serialized = $serializer->serialize(new GitHubCodeRepository());
1453
+ $serialized = $serializer->serialize(new GitHubCodeRepository(), 'json' );
1454
1454
// {"type": "github"}
1455
1455
1456
1456
$repository = $serializer->deserialize($serialized, CodeRepository::class, 'json');
You can’t perform that action at this time.
0 commit comments