title: Spring Boot Validation : coming as {1} in error message
body: <p>Trying to archive below things in REST API using spring boot,</p>
  <ol>
  <li>Entity classes annotated with</li>
  </ol>
  <blockquote>
  <p>@Size(min=4,message=&quot;Size.foo.name&quot;)</p>
  <p>private String name;</p>
  </blockquote>
  <ol start="2">
  <li>errorMessages.properties looks like below,</li>
  </ol>
  <blockquote>
  <p>errorMessages.properties<br />
  Size.foo.name=Name field must be more than {1} characters</p>
  </blockquote>
  <ol start="3">
  <li>Added below custom class advice to map spring error message to pojo error style.</li>
  </ol>
  <p>code</p>
  <pre><code>&gt; @ControllerAdvice
  @PropertySource(&quot;classpath:errorMessages.properties&quot;)
  public class RestExceptionHandler 
  { 
  
  @Autowired
  private Environment environment;
  
  @ExceptionHandler(MethodArgumentNotValidException.class)
  @ResponseStatus(HttpStatus.BAD_REQUEST)
  
  public @ResponseBody ErrorDetail handleValidationError(MethodArgumentNotValidException manve, HttpServletRequest request) {
      List&lt;FieldError&gt; fieldErrors = manve.getBindingResult().getFieldErrors();
      for(FieldError fieldError : fieldErrors) {
          System.out.println(environment.getProperty(fieldError.getDefaultMessage())); //This prints Name field must be more than {1} characters
      }
      }
  
  }
  </code></pre>
  <p>is there a way we can print the actual min size (4) as below and send to the user, or should i need to make some more configuration changes in classes?</p>
  <blockquote>
  <p>Name field must be more than 4 characters</p>
  </blockquote>