core
core copied to clipboard
Adding a group to an assertion remove enum values in the doc
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:
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'],
)]
I also notice that it has an impact on the required label.
Before:
After, I add a group to the NotNull assertion:
#[Assert\NotNull(groups: ['firstSequencePost'])]
#[Groups(['contract:post'])]
public string $code;
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.