title: how to accept json array input in jersey Rest Webservice
body: <p>Am developing a rest webservice using Jersey.Am slightly new to webservices. I need to pass List of customer as input to rest webservice. having issue in achieving it.</p>
  
  <p>Below is my customer object class</p>
  
  <pre><code>@Component
  public class customer {
  private String customerId;
  private String customerName;
  </code></pre>
  
  <p>And my endpoint is as below. addCust is the method that will be called on calling the webservice</p>
  
  <pre><code>    @Path("/add")
      @Produces({MediaType.APPLICATION_JSON})
      @Consumes({MediaType.APPLICATION_JSON})
      public String addCust(@Valid customer[] customers){
  
      //And json input is as below
      {customers:{"customerId":"1","customerName":"a"},
      {"customerId":"2","customerName":"b"}}
  </code></pre>
  
  <p>But jersey is not able to convert json array to Array of Customers. It is returning 400. And the logs shows "no viable alternative at c". How to pass Json array as input to webservice and convert into Array or ArrayList. Any help appreciated.</p>