-
Notifications
You must be signed in to change notification settings - Fork 38.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Validation error details missing regression #32396
Comments
@notizklotz Your sample application code repository is private. |
@quaff I made it public now. Sorry about that! |
Thanks for the sample. Although it does look like it, it's not actually a regression. Given this method signature: @PostMapping("/api/{mypath}/with-constraint")
public void withConstraintOnPathVariable(
@PathVariable @Pattern(regexp = "[a-z0-9-]+") String mypath,
@RequestBody @Valid RequestData mydata) {
} Method validation applies, and the In 6.1.2 the resolver applies validation, not by intent, and raises In 6.1.3, the In the mean time, as of Spring Framework 6.0 we have enhanced support for RFC 7807 error responses, and |
Thanks a lot for your elaborate answer! |
@notizklotz what should we do to get error details as for HandlerMethodValidationException? thanks. |
Spring Framework 6.1.3 introduced a regression in MVC where validation error details are not returned anymore for REST endpoints in certain cases. These settings in Spring Boot become ineffective:
I created a minimal sample application to demonstrate the issue: https://github.com/notizklotz/spring-boot-322-validation-regression
The bug appears at least in these conditions:
jakarta.validation.constraints
constraint.@Valid
annotated Pojo.With Spring Boot 3.2.0 and 3.2.1 (Spring Framework 6.1.1 and 6.1.2) the validation error of the Pojo results in a
MethodArgumentNotValidException
:With Spring Boot 3.2.2 and 3.2.3 (Spring Framework 6.1.3 and 6.1.4) this results in a
HandlerMethodValidationException
:This issue seems to be related to the changes made for #32007
The text was updated successfully, but these errors were encountered: