Update index.rst (#2015)

Replace "Symfony\Component\Serializer\Annotation\Group" by "Symfony\Component\Serializer\Annotation\Groups"
This commit is contained in:
LALLAHOM Hamdi 2022-08-04 11:58:28 +02:00 committed by GitHub
parent 1cf58fbae0
commit 3d38bba7cd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -306,13 +306,13 @@ properties and validator constraints. Take the model class below:
.. code-block:: php-annotations
use Symfony\Component\Serializer\Annotation\Group;
use Symfony\Component\Serializer\Annotation\Groups;
use Symfony\Component\Validator\Constraints as Assert;
class UserDto
{
/**
* @Group({"default", "create", "update"})
* @Groups({"default", "create", "update"})
* @Assert\NotBlank(groups={"default", "create"})
*/
public string $username;
@ -320,12 +320,12 @@ properties and validator constraints. Take the model class below:
.. code-block:: php-attributes
use Symfony\Component\Serializer\Annotation\Group;
use Symfony\Component\Serializer\Annotation\Groups;
use Symfony\Component\Validator\Constraints as Assert;
class UserDto
{
#[Group(["default", "create", "update"])
#[Groups(["default", "create", "update"])
#[Assert\NotBlank(groups: ["default", "create"])
public string $username;
}