-
Notifications
You must be signed in to change notification settings - Fork 38.2k
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
ProblemDetails not showing cause of validation error #34061
Comments
I think this behavior is implemented by Spring Framework in I'll transfer this issue there for further discussion. |
I think that should work out of the box, because the defaults for |
I don't think Spring Framework ships with message sources by default. The reference doc mentions the Message Code Arguments that are available, not the default messages. Can you try and get back to us? Thanks! |
Here are my results, I tried all 3 variants:
Result: the validation message is displayed, but the targeting parameter is missing completely:
I also tried
Result: title is taken plain, without replacing the {0} value:
Result: Exception on message rendering:
So, while the first message result improves the error message, I still think there is much room for improvement (at least including the parameter name that caused the error). |
@membersound You should try to use placeholder
|
spring-boot-3.4.0
When I enable problem-details, the validation message of my parameters should be shown in the response.
But it is still hidden. Example:
Result:
Expected result: something like "token [size = 3] ... too short"... as hint for the client-user how he can fix his 400.
The text was updated successfully, but these errors were encountered: