Skip to content

Commit 4cfacc9

Browse files
committed
bug #13315 Missing format parameter in few serialize calls (Caligone)
This PR was merged into the 4.4 branch. Discussion ---------- Missing format parameter in few serialize calls I noticed the `format` parameter from the [SerializerInterface](https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Serializer/SerializerInterface.php#L30) seems missing in a few of the Serializer examples: - https://symfony.com/doc/current/components/serializer.html#configure-name-conversion-using-metadata - https://symfony.com/doc/current/components/serializer.html#configure-name-conversion-using-metadata Commits ------- 49239d9 Missing format parameter in a serialize call
2 parents aad53f5 + 49239d9 commit 4cfacc9

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
@@ -627,7 +627,7 @@ defines a ``Person`` entity with a ``firstName`` property:
627627
This custom mapping is used to convert property names when serializing and
628628
deserializing objects::
629629

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

633633
Serializing Boolean Attributes
@@ -1499,7 +1499,7 @@ and ``BitBucketCodeRepository`` classes:
14991499
15001500
Once configured, the serializer uses the mapping to pick the correct class::
15011501

1502-
$serialized = $serializer->serialize(new GitHubCodeRepository());
1502+
$serialized = $serializer->serialize(new GitHubCodeRepository(), 'json');
15031503
// {"type": "github"}
15041504

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

0 commit comments

Comments
 (0)