-
Notifications
You must be signed in to change notification settings - Fork 38.5k
Get Serialized Names in Exception Handler #26508
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
Comments
Thanks for the suggestion. As with https://github.com/spring-projects/spring-boot/issues/25104, this issue really belongs in Spring Framework. We'll transfer the issue over to them. You can identify enhancements that belong in the Spring Boot project by their code's package. All Spring Boot code is in an |
See #26507 |
I am not sure I get the link with This seems to me that these are two layers of responsibility that should be separate. Thoughts? |
If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed. |
Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue. |
In the
ExceptionHandler
forMethodArgumentNotValidExceptions
a way for getting the serialized names of the violated fields is missing. UsingMethodArgumentNotValidException.getBindingResult().getAllErrors()
...FieldError.getField()
the POJO's name is returned which is not acceptable for the response body in case of different serialized names (Example:photoUrls
vs.photo-urls
).Code:
In this case
photoUrls
is returned which is the wrong key for the client's request.The text was updated successfully, but these errors were encountered: