I want to validate if incoming number is integer value (wihout fraction), between 0 and 100.
I have dto with javax.validation annotations:
@Min(value = 1, message = "some msg")
@Max(value = 100, message = "some msg")
@Digits(integer = 3, fraction = 0, message = "some msg")
private int someField;
Dto is used in @RestController class as input method (@PostMapping) argument.
@Min and @Max works fine, but @Digits doesn't. When I send number, for instance 95.5, it is converted to 95 and any exception is thrown. Why it is not checked by @Digits?