Annotations from javax.validation.constraints not working

后端 未结 15 1276
广开言路
广开言路 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:49

    After the Version 2.3.0 the "spring-boot-strarter-test" (that included the NotNull/NotBlank/etc) is now "sprnig boot-strarter-validation"

    Just change it from ....-test to ...-validation and it should work.

    If not downgrading the version that you are using to 2.1.3 also will solve it.

提交回复
热议问题