Skip to content

Commit d63ec8e

Browse files
committed
minor #8322 fix #8321 minor changes in Serializer Component (watlf)
This PR was submitted for the 3.3 branch but it was merged into the 2.7 branch instead (closes #8322). Discussion ---------- fix #8321 minor changes in Serializer Component Commits ------- 02b7732 fix #8321 minor changes in Serializer Component
2 parents c368140 + 02b7732 commit d63ec8e

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)