-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Compose validation #35226
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
The case of a |
It actually do solve with the dedicated min/max messages. The type of failure will depend if there are less than min or more than max constraints validated. You can see the minMessage set for this purpose. |
But if you have |
What would be the use case? The Some proposed in #9888 seems to have the same flaw, but it does not looks like an issue to me actually. The purpose is to validate the right constraints, not to decline depending on which have failed. The validator couldn't carry this information anyway. |
Thank you for this suggestion. |
Hello? This issue is about to be closed if nobody replies. |
Hey, I didn't hear anything so I'm going to close it. Feel free to comment if this is still relevant, I can always reopen! |
Uh oh!
There was an error while loading. Please reload this page.
Description
Creates a new composite constraint to validate a composition of constraints. The minumum and maximum validated should be set optionnaly.
Example
For example, there are two use case that could be easily answered with such a composition.
Often there are security rules to enforce for a new password. Those are limited set, and not all of the rules are mandatory for a valid password. For example, we could have the rules with the following statement:
It is an issue to enforce that a password is complex enough in the current state. Allowing to compose constraints enables simpler code:
Basic code
To me, a Compose annotation could look like this:
The text was updated successfully, but these errors were encountered: