title: validation on REST request payload
body: <p>I am trying to apply validation on REST request using "hibernate-validator-5.1.3.final" jar.I am able to do it for outer bean but not for inner bean.So can anyone help me to do it.Thanks in advance.</p>
  
  <p><strong>Request through Postman</strong></p>
  
  <pre><code>{
      "employeeDetails": [{
                             "employeeId": "123456",
                             "dept" : 101,
                             "salary" : 30000,
                             "status":"active"                              
                  }]
  }
  </code></pre>
  
  <p><strong>pom.xml</strong></p>
  
  <pre><code>&lt;dependency&gt;
      &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
      &lt;artifactId&gt;hibernate-validator&lt;/artifactId&gt;
      &lt;version&gt;5.1.3.Final&lt;/version&gt;
  &lt;/dependency&gt;
  </code></pre>
  
  <p><strong>Controller</strong></p>
  
  <pre><code>@RequestMapping(method = RequestMethod.POST, value = "/addEmployee", headers = "Accept=application/json")
      public @ResponseBody void addEmployee(
              @RequestHeader @Valid @RequestBody AddEmployeeBean requestBean,
              HttpServletRequest httpRequest) {.....}
  </code></pre>
  
  <p><strong>Outer Bean - AddEmployeeBean</strong></p>
  
  <pre><code>public class AddEmployeeBean {
      @Valid
      private EmployeeBean employeeBean;
      @NotEmpty
      private List&lt;EmployeeBean&gt; employeeDetails;
             |
             |
           getter- setter  
  }
  </code></pre>
  
  <p><strong>Inner Bean - EmployeeBean</strong></p>
  
  <pre><code>public class EmployeeBean {
      @NotEmpty
      private String employeeId;
      @NumberFormat(style = Style.NUMBER)
      private long dept;
      @NumberFormat(style = Style.NUMBER)
      private long salary;
      @NotEmpty
      private String status;
             |
             |
           getter- setter 
  }   
  </code></pre>