Where the validation function was implemented using Spring Boot 2.3.1. Annotations such as @Size and @NotNull (javax.validation *) were no longer available.
Added the following dependencies.
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
</dependency>
dependencies {
...
implementation 'org.springframework.boot:spring-boot-starter-validation'
}
When using version 2.3 or earlier, the javax.validation * library could be used by loading the following starter. It seems that it was not included from 2.3.
implementation 'org.springframework.boot:spring-boot-starter-web'
Reference https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-2.3-Release-Notes#validation-starter-no-longer-included-in-web-starters
Recommended Posts