-
Notifications
You must be signed in to change notification settings - Fork 54
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
Be able to compose Pattern list with OR expression #157
Comments
Hey there, I think we discussed it in the past but I can't recall the reason why we did not execute. |
I have put the same question in the official forum https://discourse.hibernate.org/t/multiple-pattern-validator-with-or/3327 I know that the proposal is simple, but accepting nested AND / OR structure IMHO is cross for all validations. I mean, it could be awesome for grouping different validations. Nowadays Hibernates bean validation implementation could do with @ConstraintComposition annotation. https://docs.jboss.org/hibernate/validator/5.3/reference/en-US/html_single/#section-boolean-constraint-composition. But this case is a more simple case. Pattern.List actually groups all patterns with AND composition. With this change, the implementation could read this parameter and apply the composition with the desired union operator without having the more complex cross @ConstraintComposition annotation. Maybe, as the reference implementation could do this, why not adding this annotation as API spec? It could be awesome |
Ah I see, this would be for |
Nowadays @pattern validator is able to match a list of patterns. But the validation passes if all of pattern matches.
It could be helpful having a @Pattern.List configuration for tell the need to pass all (AND composition) or at least one (OR composition)
The text was updated successfully, but these errors were encountered: