api-platform/core

Adding a group to an assertion remove enum values in the doc

ecourtial opened this issue · 1 comments

API Platform version(s) affected: 3.3.11

Description

I use a basic #[Assert\Choice constraint.

   #[Assert\Choice(
        choices: self::ASSOCIATE_AS_VALUES,
        message: 'Choose a valid association mode.',
    )]

The documentation is properly generated with the values:
1

But as soon as I add a group to this assertion, the authorized choices are no longer displayed in the doc.

   #[Assert\Choice(
        choices: self::ASSOCIATE_AS_VALUES,
        message: 'Choose a valid association mode.',
        groups: ['firstSequencePost'],
    )]

2

I also notice that it has an impact on the required label.

Before:

b2

After, I add a group to the NotNull assertion:

    #[Assert\NotNull(groups: ['firstSequencePost'])]
    #[Groups(['contract:post'])]
    public string $code;

b1