I am building a project using Spring Boot 2.1.8, I have spring-boot-starter-web in my POM and I can see Maven pulling hibernate-validator 6.0.17 onto the classpath.
I have my messages in the resource folder and they appear to be looked up correctly so that when I change the locale Spring loads the message from the correct file.
The relevant method in my @RestController takes a @Valid and @RequestBody annotated DTO. It triggers the ResponseEntityExceptionHandler#handleMethodArgumentNotValid() to fire in my controller advice when the DTO fails validation.
My DTO has a field annotated in the following manner:
My messages.properties has the following entries:
This is how my message is written to the response:
As you can see the message parameters are not interpolated, instead the curly braces are stripped - the same happens when I use {0} instead of {min} or when I let the Size annotation use the default message - javax.validation.constraints.Size.message.
Can you please advise?