jakartaee / validation-tck

Jakarta Validation TCK
http://validator.hibernate.org
Apache License 2.0
38 stars 33 forks source link

`@Min` validation a String #194

Open dstepanov opened 9 months ago

dstepanov commented 9 months ago

Looking at this test org.hibernate.beanvalidation.tck.tests.constraints.validatorresolution.ValidatorResolutionTest#testResolutionOfMinMaxForDifferentTypes

I don't understand why would @Min work on a String type; it's JavaDoc doesn't say anything about validating a String.

public class MinMax {
    @Min(10l)
    @Max(20l)
    Number number;

    @Min(10l)
    @Max(20l)
    String numberAsString;

    public MinMax(String stringNumber, Number number) {
        this.numberAsString = stringNumber;
        this.number = number;
    }
}