Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b072fe9

Browse files
committed
minor #17379 [Serializer] Fixup attributes import (ogizanagi)
This PR was merged into the 5.4 branch. Discussion ---------- [Serializer] Fixup attributes import Re-reading the rendered doc at https://symfony.com/doc/5.4/serializer.html#serializer-context, spotted I missed this. Commits ------- 34881a8 [Serializer] Fixup attributes import
2 parents f83e1d3 + 34881a8 commit b072fe9

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

serializer.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -256,13 +256,14 @@ You can also restrict the usage of a context to some groups::
256256
namespace App\Model;
257257

258258
use Symfony\Component\Serializer\Annotation\Context;
259+
use Symfony\Component\Serializer\Annotation\Groups;
259260
use Symfony\Component\Serializer\Normalizer\DateTimeNormalizer;
260261

261262
class Person
262263
{
263-
#[Serializer\Groups(['extended'])]
264-
#[Serializer\Context([DateTimeNormalizer::FORMAT_KEY => \DateTime::RFC3339])]
265-
#[Serializer\Context(
264+
#[Groups(['extended'])]
265+
#[Context([DateTimeNormalizer::FORMAT_KEY => \DateTime::RFC3339])]
266+
#[Context(
266267
context: [DateTimeNormalizer::FORMAT_KEY => \DateTime::RFC3339_EXTENDED],
267268
groups: ['extended'],
268269
)]

0 commit comments

Comments
 (0)