Add support for javax.validation.constraints.NotBlank
#1753
Labels
Milestone
javax.validation.constraints.NotBlank
#1753
Currently, Jsr303AwarePropertyMetadata indicates that a property is required if the property is annotated with javax.validation.constraints.NotNull but it does not give the same consideration to properties annotated with javax.validation.constraints.NotBlank.
The presence of the
@NotBlank
annotation should be considered equivalent to the property being annotated with@NotNull @Pattern(regex = "^\\s*(\\S+\\s*)+$")
.Ideally, Jsr303AwarePropertyMetadata would support this annotation by updating its
isRequired
andgetPattern
methods. However, Jsr303AwarePropertyMetadata currently assumes that a property has zero-or-one@Pattern
annotations, which is not valid. A property may have zero-or-more patterns.In the case where a property is annotated with both
@NotBlank
and@Pattern
, it may be acceptable to ignore the pattern implied by the@NotBlank
annotation. Otherwise, it may be necessary to introduce agetPatterns
method and deprecategetPattern
.The text was updated successfully, but these errors were encountered: