Skip to content

Commit

Permalink
minor #20457 [Serializer] Add missing argument (famoser)
Browse files Browse the repository at this point in the history
This PR was merged into the 6.4 branch.

Discussion
----------

[Serializer] Add missing argument

In the example, the `$context` is constructed, but then forgot to be passed to the `serializer`.

This functionality is first documented in 6.4, hence I target this branch.

Commits
-------

d94be3f Add missing argument
  • Loading branch information
javiereguiluz committed Dec 9, 2024
2 parents 6096fec + d94be3f commit b89995c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion serializer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1818,7 +1818,7 @@ property. This can be used instead of
},
],
];
$jsonContent = $serializer->serialize($person, 'json');
$jsonContent = $serializer->serialize($person, 'json', $context);
// $jsonContent contains {"name":"cordoval","age":34,"createdAt":"2014-03-22T09:43:12-0500"}

Advanced Deserialization
Expand Down

0 comments on commit b89995c

Please sign in to comment.