Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 885e9c3 + b072fe9 commit de43ff1Copy full SHA for de43ff1
serializer.rst
@@ -241,13 +241,14 @@ You can also restrict the usage of a context to some groups::
241
namespace App\Model;
242
243
use Symfony\Component\Serializer\Annotation\Context;
244
+ use Symfony\Component\Serializer\Annotation\Groups;
245
use Symfony\Component\Serializer\Normalizer\DateTimeNormalizer;
246
247
class Person
248
{
- #[Serializer\Groups(['extended'])]
249
- #[Serializer\Context([DateTimeNormalizer::FORMAT_KEY => \DateTime::RFC3339])]
250
- #[Serializer\Context(
+ #[Groups(['extended'])]
+ #[Context([DateTimeNormalizer::FORMAT_KEY => \DateTime::RFC3339])]
251
+ #[Context(
252
context: [DateTimeNormalizer::FORMAT_KEY => \DateTime::RFC3339_EXTENDED],
253
groups: ['extended'],
254
)]
0 commit comments