-
Notifications
You must be signed in to change notification settings - Fork 38.4k
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
Spring WebFlux - Custom messages validation in different languages [SPR-17231] #21764
Comments
Juergen Hoeller commented We could potentially (re-)expose a short-lived thread-local for affected callbacks in WebFlux. This would be the easiest way to make existing locale resolution work... Otherwise we'd have to support an explicit |
Rossen Stoyanchev commented jakubdyszkiewicz thanks for the sample project, and sorry for the delay! Juergen Hoeller, we could set Couldn't we pass the |
Any updates on this? |
Someone have custom implementation for this? |
Any news here? |
This is now superseded by the attached pull request #28739. |
jakubdyszkiewicz opened SPR-17231 and commented
Hello,
I've got a problem with providing custom messages in different languages for bean validation using WebFlux. It does not use messages for locale I send in header.
I think this is a bug because
LocalValidatorFactoryBean
usesLocaleContextMessageInterpolator
. Hibernate Validator calls thepublic String interpolate(String message, Context context) method
, which relays on theLocaleContextHolder
. It uses aThreadLocal
which can't be used in WebFlux.I created sample repository, I hope you find it helpful
https://github.com/jakubdyszkiewicz/webflux-validation
There is the issue I created by mistake in spring-boot project spring-projects/spring-boot#14253
Dmytro Nosan provided workaround, but I think it should work out of the box.
Thanks
Referenced from: commits spring-attic/spring-framework-issues@d059b1a
The text was updated successfully, but these errors were encountered: