Closed
Description
Description
I'd like to propose a few steps to improve the validation constraints:
- Deprecate empty strings (
""
) currently happily passing in string constraints (e.g.Email
) - Deprecate non string values in
NotBlank
/Blank
and 'whitespaced' strings passing (" "
) - Consider
NotEmpty
/Empty
as the currentNotBlank
/Blank
constraints- https://docs.jboss.org/hibernate/stable/beanvalidation/api/javax/validation/constraints/NotEmpty.html
- I dont think we should add these (but favor specific constraints) as
empty
in PHP is different as described above (ints, bools, etc). Not sure we should follow either one :) thus possible confusion
If this happens we'd do simply
@Email
@NotNull @Email
@NotNull @Length(min=3) @NotBlank
@NotNull @NotBlank
@Type(array) @Count(3)
Thoughts?