I've a very simple spring boot controller with param validation.
@GetMapping(value = "/test/{p}")
@NonNull
public String test(@PathVariable(value = "p", required = true) @Valid @Size(min = 2) String t) {
return "";
}
if I send any string longer than 2 letters it returns 200, but if I send any 1 letter string it returns 500. I would like the return code for failed validation be 400 which makes much more sense... how can i set the status code for constraint validation fail on spring boot controller