Skip to content

Conversation

@soyuka
Copy link
Member

@soyuka soyuka commented Jun 26, 2025

Q A
Branch? 4.1
License MIT

The default type for parameters is list|string, but as soon as we got a collection we forced the validation on the All constraints, constraint that wants an array. This wraps our assertion as:

                $assertions = $assertions ? [new AtLeastOneOf([new Sequentially($assertions), new All($assertions)])] : [];

When both types may be expected. Note that if castAsArray is set, we only use the All assertion. Ping @aegypius @deguif

@soyuka soyuka force-pushed the fix/parameter-validator-union branch from e45a2bf to 6f02200 Compare June 27, 2025 11:53
@soyuka soyuka merged commit bf271d1 into api-platform:4.1 Jun 27, 2025
109 of 111 checks passed
@soyuka soyuka deleted the fix/parameter-validator-union branch June 27, 2025 14:05
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.

1 participant