Skip to content

Spring WebFlux - Custom messages validation in different languages #14253

Closed
@jakubdyszkiewicz

Description

@jakubdyszkiewicz

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 uses LocaleContextMessageInterpolator. Hibernate Validator calls the public String interpolate(String message, Context context) method, which relays on the LocaleContextHolder. It uses a ThreadLocal which can't be used in WebFlux.

I created sample repository, I hope you find it helpful
https://github.com/jakubdyszkiewicz/webflux-validation

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    for: external-projectFor an external project and not something we can fix

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions