title: Validate a json field based on another field dynamically
body: <p>I started to use validation framework <code>@Valid</code> to validate json request with jax-rs</p>
  
  <p>Is it possible to validate a field against another field?</p>
  
  <p>So this is how I wanna construct the request body:</p>
  
  <pre><code>@JsonProperty
  private Integer peopleCount
  
  @JsonProperty
  @Min(value = 0)
  @Max( value = peopleCount)
  private Integer personId;
  </code></pre>
  
  <p>So when I pass </p>
  
  <pre><code>{
       "peopleCount":2,
       "personId": 4
  }
  </code></pre>
  
  <p>it should throw an error</p>
  
  <p>but <code>@Max( value = peopleCount)</code> does not work since it requires a constant value</p>
  
  <p>please note that I'm trying to validate against the json request itself and not the values saved in DB</p>
  
  <p>Thanks in advance</p>