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

Skip to content

Commit 34881a8

Browse files
authored
[Serializer] Fixup attributes import
1 parent f83e1d3 commit 34881a8

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)