Skip to content

Comments

fix(validator): missing required properties when using GroupSequence#7784

Open
VincentLanglet wants to merge 2 commits intoapi-platform:4.2from
VincentLanglet:fixGroupSequence
Open

fix(validator): missing required properties when using GroupSequence#7784
VincentLanglet wants to merge 2 commits intoapi-platform:4.2from
VincentLanglet:fixGroupSequence

Conversation

@VincentLanglet
Copy link
Contributor

@VincentLanglet VincentLanglet commented Feb 20, 2026

Q A
Branch? 4.2
Tickets Closes #..., closes #...
License MIT
Doc PR api-platform/docs#...

When using GroupSequence on a Class, ApiPlatform keep comparing the constraints groups with the Default one in order to generate de required ones, instead of checking with the groups from the GroupSequence.

@VincentLanglet VincentLanglet marked this pull request as ready for review February 20, 2026 17:41
@soyuka soyuka changed the title Fix missing required properties when using GroupSequence fix(validator): missing required properties when using GroupSequence Feb 20, 2026
*
* @author Baptiste Meyer <baptiste.meyer@gmail.com>
*/
#[Assert\GroupSequence(['dummy', 'DummyValidatedEntityWithGroupSequence'])]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

interesting as 8031652 works, I'm wondering if there's something that we should do rather in the contextthen inside property metadata factories but I'm unsure about this...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure how it's related.
And I just discover the GroupSequence feature today. So I dunno

My issue is not related to the fact it's validated (I think it works), only to the schema changed (loosing the "required" flag) when generating the OpenAPI schema.

Adding a GroupSequence to a class is something documented on Symfony
https://symfony.com/doc/current/validation/sequence_provider.html
so should be supported in the ValidatorPropertyMetadataFactory, no ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants