title: Should you use @NotNull and @JsonProperty(required) in the same object
body: <p>So I'm looking at adding constraints to my json views.</p>
  
  <p>I have class similar to this one</p>
  
  <pre><code>public class Person {
      @JsonProperty(required = true)
      @NotNull
      @Size(max = 50)
      private String name;
  }
  </code></pre>
  
  <p>Should I keep both <code>@JsonProperty(required = true)</code> and <code>@NotNull</code> or should I remove one and why?</p>
  
  <hr>
  
  <p>Just to be clear since Jackson 2.6 <code>@JsonProperty(required = true)</code> does throw an <a href="https://github.com/FasterXML/jackson-databind/issues/781" rel="noreferrer">exception</a>.</p>
  
  <p>I'm using springfox-swagger and it looks like when I remove <code>@JsonProperty(required = true)</code> the field in the swagger is marked as optional which it isn't.</p>
  
  <p>I'm just wondering about the best practice in this situation.</p>