Skip to content

Commit e69c1a5

Browse files
committed
bug #11562 Update serializer.rst (Ldiro)
This PR was merged into the 4.2 branch. Discussion ---------- Update serializer.rst There's a typo on the "ignored_attributes", it must be an array <!-- If your pull request fixes a BUG, use the oldest maintained branch that contains the bug (see https://symfony.com/roadmap for the list of maintained branches). If your pull request documents a NEW FEATURE, use the same Symfony branch where the feature was introduced (and `master` for features of unreleased versions). --> Commits ------- fbc35cf Update serializer.rst
2 parents d14a32a + fbc35cf commit e69c1a5

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)