10000 Update serializer.rst · symfony/symfony-docs@fbc35cf · GitHub
[go: up one dir, main page]

Skip to content

Commit fbc35cf

Browse files
authored
Update serializer.rst
There's a typo on the "ignored_attributes", it must be an array
1 parent d14a32a commit fbc35cf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

components/serializer.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ key in the ``context`` parameter of the desired serializer method::
416416
$encoder = new JsonEncoder();
417417

418418
$serializer = new Serializer([$normalizer], [$encoder]);
419-
$serializer->serialize($person, 'json', ['ignored_attributes' => 'age']); // Output: {"name":"foo"}
419+
$serializer->serialize($person, 'json', ['ignored_attributes' => ['age']]); // Output: {"name":"foo"}
420420

421421
.. deprecated:: 4.2
422422

0 commit comments

Comments
 (0)
0