Hey there!
When I started a new Spring Boot Project. I just creating controller normally till I found out that @Valid
Annotation is not recognized and basically can't be founded.
Even I imported the package that contains the annotation:
Is that the new bug or something?
Comment From: wilkinsona
As of Spring Boot 2.3, if you want to use bean validation and Hibernate Validator, you must add a dependency on spring-boot-starter-validation
as described in the release notes.
Comment From: YShane
I don't want to say this should me more prominent, but I'll say it any way.
Comment From: AbhishekAnand01
I have also faced the same issue and I am able to solve the issue by adding Sprign-boot-validator dependency in pom.xml file
from Spring Boot 2.3.0 we need to add below dependency in our project.
<!-- <dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
</dependency> -->
Hope this will help you.