For example, I have a simple controller in Micronaut
@Controller("/hello")
public class MyApi implements Api {
@Override
public String hello(Integer i) {
return "Num: " + i;
}
}
@Validated
interface Api {
@Get("/")
String hello(@QueryValue @Max(10) Integer i);
}
Annotation @Max
doesn't work, any numbers aren't validated. But the same example written in Spring works fine.
Everything works when add dependency
<dependency>
<groupId>io.micronaut.beanvalidation</groupId>
<artifactId>micronaut-hibernate-validator</artifactId>
</dependency>
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.