I have a simple class, which I’d like to validate: This class is validated as part of the inputs of a spring controller method. I managed to configure the validation of the fields (someField in this case), but for some reason the methodConstraint() isn’t even invoked, let alone validated. I rememb…
Tag: spring-validator
spring boot starter validation simply not working
Problem: I need to validate some json inputs and outputs in my Spring API, I’m trying to use spring boot starter validation (Already know that is not into spring-boot-starter-web, so I added it manually) but it never throws the exception when something is bad based on the validations in the DTO class (M…
Validate request with List as a field with javax.validation
I am using javax.validation for validating request in an API developed using spring. I have to validate List<Integer> so that all values must be a positive number and size of the list must be exactly equal to some fix number e.g. 2. Valid request should be [ 1,2] Invalid request should be [-1,2] or [1,2…