@NotNull annotation is not enforced for @RequestParam when parameter is passed as an empty value #26841
Labels
in: web
Issues in web modules (web, webmvc, webflux, websocket)
status: duplicate
A duplicate of another issue
Affects: \Spring Boot v2.3.9.RELEASE, Spring v5.2.13.RELEASE
When annotating a parameter of type Long of a controller with @NotNull for a @get method and passing the parameter as empty value, the parameter is received as null.
Getting 400 when requesting http://localhost:8082/testController1/testMethod1
Getting 200 when requesting http://localhost:8082/testController1/testMethod1?param1=555
Getting 500 when requesting http://localhost:8082/testController1/testMethod1?param1=¶m2=bla
Expecting to 400 for the last case too.
The text was updated successfully, but these errors were encountered: