Annotations from javax.validation.constraints not working

后端 未结 15 1393
广开言路
广开言路 2020-11-28 06:23

What configuration is needed to use annotations from javax.validation.constraints like @Size, @NotNull, etc.? Here\'s my code:

15条回答
  •  孤街浪徒
    2020-11-28 06:32

    In my case, I was using spring boot version 2.3.0. When I changed my maven dependency to use 2.1.3 it worked.

    
        org.springframework.boot
        spring-boot-starter-parent
        2.1.3.RELEASE
         
    
    
        
            javax.validation
            validation-api
        
    
    

提交回复
热议问题