-
Notifications
You must be signed in to change notification settings - Fork 38.5k
Change of behaviour for UUID in bean validation output in v5.3.27 #30661
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
This is a regression caused by #30286. Since we intend to release 6.0.10 and 5.3.28 this week, I'll pick this up directly. Thanks for the report, and thanks for volunteering! With more lead-up time, I'd be happy to help with a pull request next time. |
Ok :) thank you! |
@vandeven since we're considering a wider revision here for 6.0.11 / 5.3.29, could you please clarify how you are consuming the |
I was doing it indirectly through bean validation. @Valid in combination with a custom ConstraintValidator, resulting in an error message: org.springframework.validation.BeanPropertyBindingResult: 3 errors (omitted some parts because it is code of the client im working for) and we get this result from just calling mockmvc
And I cannot seem to find any error handler for this. |
UpdateChanges made to Improvements to |
Uh oh!
There was an error while loading. Please reload this page.
Affects: 5.3.27
Hello spring team!
I tried to update my spring-boot application, and I found a change of behaviour in bean validation output on how it renders UUID's
The old behaviour would show the .toString() version of the UUID, the new version would show the object id instead.
I traced it down to this change:
https://github.com/spring-projects/spring-framework/blob/v5.3.26/spring-context/src/main/java/org/springframework/validation/FieldError.java
to
https://github.com/spring-projects/spring-framework/blob/v5.3.27/spring-context/src/main/java/org/springframework/validation/FieldError.java
in the toString() of FieldError
ObjectUtils.nullSafeToString(this.rejectedValue)
was changed toObjectUtils.nullSafeConciseToString(this.rejectedValue)
Here it checks if it is a "isSimpleValueType" and if so, it calls the toString() and otherwise it returns the typename.
From reading the issues I think this change happend because otherwhise whole object hierarchies would be included, which is not really useful. UUID's do sound like an exception to this rule.
I do not mind making a pull request for this myself (would be nice to help spring :)) but I would like some guidance to where you think it is best to solve this (if you consider this desirable behaviour). I could UUID to the isSimpleValueType method, or should I make a special case for this?
Kind regards
Ties
The text was updated successfully, but these errors were encountered: