title: serializing annotations as well as fields to JSON
body: <p>I have a spring boot app, and I want to send DTO validation constraints as well as field value to the client.</p>
  
  <p>Having DTO</p>
  
  <pre><code>class PetDTO {
    @Length(min=5, max=15)
    String name;
  }
  </code></pre>
  
  <p>where name happens to be 'Leviathan', should result in this JSON being sent to client:</p>
  
  <pre><code>{
      name: 'Leviathan'
      name_constraint: { type: 'length', min:5, max: 15},
  }
  </code></pre>
  
  <p>Reasoning is to have single source of truth for validations. Can this be done with reasonable amount of work? </p>