title: How do I validate the JSON request in Spring Boot?
body: <p>I want to validate the JSON request which I am receiving from the client side.
  I have tried using the annotations (<code>@notnull, @length(min=1,max=8)</code>, etc., etc.) and it is working fine but the problem is that I am not able to get the fields and messages which will be getting invoked if they are invalid. 
  Although, I am getting an error message in my Console.</p>
  
  <p>List of constraint violations:</p>
  
  <pre><code>[
    ConstraintViolationImpl
    {
      interpolatedMessage=
      'must be greater than or equal to 900000000',
      propertyPath=phoneNumber,
      rootBeanClass=class
      com.org.infy.prime.RestWithJPA.CarrierFile,
      messageTemplate=
      '{javax.validation.constraints.Min.message}'
    }
    ConstraintViolationImpl
    {
      interpolatedMessage=
      'length must be between 1 and 20',
      propertyPath=accountID,
      rootBeanClass=class
      com.org.infy.prime.RestWithJPA.CarrierFile,
      messageTemplate=
      '{org.hibernate.validator.constraints.Length.message}'
    }
  ]
  </code></pre>
  
  <p>Request if anyone can help me on this or atleast give me an alternative to validate the request in a more efficient manner.</p>
  
  <p><strong>PS:</strong> I don't want to validate it field by field.</p>