title: How to unmarshall json lists using Spring Boot RestTemplate
body: <p>I have to parse a REST response in json and it has a lot of nested lists with many objects. </p>
  
  <p>The response contains an item called "ObjectList" which has a list and inside, two elements, "ObjectA" and "ObjectB". I don't know how to parse the response to objects using Jackson annotations.</p>
  
  <p>The json looks like this:</p>
  
  <pre><code>    "ObjectList": [
              {
                  "ObjectA": {
                      "property1": false,
                      "property2": true
              },
                  "ObjectB": {
                      "property1": 66,
                      "property2": true
              },
              {
                  "ObjectA": {
                      "property1": false,
                      "property2": true
              },
                  "ObjectB": {
                      "property1": 66,
                      "property2": true
              }
          }
      ]
  }
  </code></pre>
  
  <p>My code looks like this</p>
  
  <pre><code>    ResponseEntity&lt;Response&gt; response = restTemplate.exchange(URL, HttpMethod.GET, request, Response.class);
      Response response = response.getBody();
  </code></pre>
  
  <p>Response is:</p>
  
  <pre><code>    @JsonIgnoreProperties(ignoreUnknown = true)
      public class TimesheetListResponse {
  
          @JsonProperty("ObjectA")
          private List&lt;ObjectA&gt; objectAList;
  
          @JsonProperty("ObjectB")
          private List&lt;ObjectB&gt; objectBList;
  </code></pre>
  
  <p>That does not work at all, and I'm confused about how to map this. </p>