title: Spring Boot Request body validation on same DTO used for different API
body: <p>In my request body DTO, I want specific fields to be required for one of the API but not for another.</p>
  <p>My request body:</p>
  <pre class="lang-java prettyprint-override"><code>@Data
  class MyClass {
      
      @NotNull
      private String fullName;
      
      @NotNull
      private String firstName;
      
      @NotNull
      private String lastName;
  }
  </code></pre>
  <p>I want <code>fullName</code> to be required for <code>/api/v1</code> but not for <code>/api/v2</code>. I am using <code>@Valid</code> on request body from <code>javax.validation</code>.</p>