title: Spring boot validate that field is of type string
body: <p>I have a class that represents form submit:</p>
  
  <pre><code>Class Form {
     // @String(message = "Invalid type")
     private String name;
  }
  </code></pre>
  
  <p>I was looking for a <code>javax.validation</code> annotation to put on top of the <code>name</code> field, that will validate that the field is indeed of type string, and if not, display an appropriate error message, but I couldn't find one. What's the way to do it?</p>
  
  <p><strong>Clarification:</strong></p>
  
  <p>What bothers me is a case where someone sends one of the following payloads, and I still haven't seen a solution for that:</p>
  
  <pre><code>{
    name: true
  }
  </code></pre>
  
  <p>or</p>
  
  <pre><code>{
    name: 1234
  }
  </code></pre>