8000 fix #8321 minor changes in Serializer Component · symfony/symfony-docs@02b7732 · GitHub
[go: up one dir, main page]

Skip to content

Commit 02b7732

Browse files
watlfxabbuh
authored andcommitted
fix #8321 minor changes in Serializer Component
1 parent c368140 commit 02b7732

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
@@ -408,9 +408,9 @@ and :class:`Symfony\\Component\\Serializer\\Normalizer\\PropertyNormalizer`::
408408
$obj->name = 'Acme Inc.';
409409
$obj->address = '123 Main Street, Big City';
410410

411-
$json = $serializer->serialize($obj);
411+
$json = $serializer->serialize($obj, 'json');
412412
// {"org_name": "Acme Inc.", "org_address": "123 Main Street, Big City"}
413-
$objCopy = $serializer->deserialize($json);
413+
$objCopy = $serializer->deserialize($json, Company::class, 'json');
414414
// Same data as $obj
415415

416416
.. _using-camelized-method-names-for-underscored-attributes:

0 commit comments

Comments
 (0)
0