title: How to interpolate message dynamically in ConstraintValidator with property node?
body: <p>Assume I have simple dto with one field and this dto is also annotated with custom validation annotation:</p>
  
  <pre><code>@CustomAnnotation
  public class SimpleDto {
      private String field;
  }
  // setters and getters omited
  </code></pre>
  
  <p>Custom annotation:</p>
  
  <pre><code>@Target(TYPE)
  @Retention(RUNTIME)
  @Constraint(validatedBy = CustomValidator.class)
  @Documented
  public @interface CheckMondialRelayShopOrderWeight {
      String message() default "{temp.key.message}";
  
      Class&lt;?&gt;[] groups() default {};
  
      Class&lt;? extends Payload&gt;[] payload() default {};
  }
  </code></pre>
  
  <p>and finally validator itself:</p>
  
  <pre><code>public class CustomValidator implements
      ConstraintValidator&lt;CustomAnnotation, SimpleDto&gt; {
      @Override
      public void initialize(CustomAnnotation constraintAnnotation) {}
  
      @Override
      public boolean isValid(SimpleDto value, 
                          ConstraintValidatorContext context) {
          HibernateConstraintValidatorContext hibernateContext = context.unwrap(HibernateConstraintValidatorContext.class);
              hibernateContext.addMessageParameter("dynamicValue", 130);
              hibernateContext.buildConstraintViolationWithTemplate(hibernateContext.getDefaultConstraintMessageTemplate()).addPropertyNode("field").addConstraintViolation().disableDefaultConstraintViolation();
          return false;
      }
  }
  </code></pre>
  
  <p>and in application.properties:</p>
  
  <pre><code>CustomAnnotation.simpleDto.field=Your dynamic value is {dynamicValue}
  </code></pre>
  
  <p>But this doesn't work, this works just fine if I put <code>hibernateContext.buildConstraintViolationWithTemplate("Your dynamic value is {dynamicValue}").addConstraintViolation().disableDefaultConstraintViolation();</code> instead of <code>hibernateContext.buildConstraintViolationWithTemplate(hibernateContext.getDefaultConstraintMessageTemplate()).addPropertyNode("field").addConstraintViolation().disableDefaultConstraintViolation();</code></p>
  
  <p>I can't figure out how to use the interpolation with addPropertyNode. Any suggestions?</p>