title: How to do conditional validation in spring boot?
body: <p>I am developing a Spring REST application.</p>
  
  <p>I have a DTO</p>
  
  <pre><code>private String name;
  @
  private String nationality;
  private String matchType;
  private List&lt;NC_Field&gt; ncFields = new ArrayList();
  // Getters and Setters
  </code></pre>
  
  <p>I have 3 tables</p>
  
  <ol>
  <li>Field Table</li>
  <li>Name Clearance Table</li>
  <li>NC_Fields Table</li>
  </ol>
  
  <p><a href="https://i.stack.imgur.com/8abcd.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8abcd.png" alt="enter image description here"></a></p>