-
Notifications
You must be signed in to change notification settings - Fork 41.9k
Bean validation not picking error translations anymore #18672
Copy link
Copy link
Closed
Labels
type: regressionA regression from a previous releaseA regression from a previous release
Milestone
Description
I have a spring boot application with default bean validation through hibernate validator.
I'm using custom messageSource - which in fact just picks up translations from diferrent places.
On my model classes I'm using custom messages like:
@NotBlank(message = "{validation.error.name.blank}")Using this setup with Spring Boot 2.1.9 everything works fine and my messages are picked up correctly.
With 2.2.0 it shows "{validation.error.name.blank}" as a result. When there is no custom message on annotation: @NotBlank then it shows default message found in ValidationMessages.properties inside validation jar like "must not be blank".
In my WebMvcConfiguration I'm defining validator bean:
@Override
public Validator getValidator() {
LocalValidatorFactoryBean validator = new LocalValidatorFactoryBean();
validator.setValidationMessageSource(messageSource);
return validator;
}I can't find if the is any change according to this in boot or spring framework 5.2
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
type: regressionA regression from a previous releaseA regression from a previous release