title: Parsing a list of objects got from an API
body: <p>Hi i am using retrofit to call my API with spring boot.</p>
  
  <p>API Response</p>
  
  <pre><code>    [
           {
               "name": "whishky",
               "price": 1000
           },
           {
               "name": "vodka",
               "price": 200
           }
      ]
  </code></pre>
  
  <p>My pojo class looks like </p>
  
  <pre><code>public class MyResponse {
      List&lt;MyObject&gt; resp;
  }
  </code></pre>
  
  <p>And MyObject class looks like</p>
  
  <pre><code>public class MyObject implements Serializable {
  
      @JsonProperty("name")
      private String name;
  
      @JsonProperty("price")
      private Double price;
  }
  </code></pre>
  
  <p>API call</p>
  
  <pre><code>Call&lt;MyResponse&gt; saveRequestCall = MyApi.fetchData(request);
  Response&lt;MyResponse&gt; execute = saveRequestCall.execute();
  </code></pre>
  
  <p>Now the problem is when i call the API i am getting the exception </p>
  
  <pre><code>2020-04-25 18:08:18,895 ERROR c.s.e.b.XYZServiceImpl Error in fetching datawith exception com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize instance of `zzz.MyResponse` out of START_ARRAY token
   at [Source: (InputStreamReader); line: 1, column: 1]
  </code></pre>
  
  <p>Any help will be appreciated regarding how i can parse this.</p>