title: Map JSON array to List using RestTemplate
body: <p>I'm having trouble mapping the <code>environments</code> array in the below JSON response output into a list of <code>Environment</code> objects using <code>RestTemplate</code>.</p>
  
  <p>The <code>name</code> property of ApplicationData is being populated with <code>Deploy app</code> which is correct. However, the list of environments in Application Data is <code>null</code>.  I'd like it to be populated with the corresponding id's and names from the output.</p>
  
  <p><strong><em>JSON output</em></strong></p>
  
  <pre><code>{
      "id": 4587521,
      "oid": 8738390651982315522,
      "name": "Deploy app",
      "description": "",
      "environments": [
          {
              "id": 4751361,
              "name": "Stage",
              "position": 0,
              "configurationState": "TASKED"
          },
          {
              "id": 4751362,
              "name": "Dev",
              "position": 1,
              "configurationState": "TASKED"
          },
      ]
  }
  </code></pre>
  
  <p><strong><em>ApplicationData.java</em></strong></p>
  
  <pre><code>@JsonIgnoreProperties(ignoreUnknown = true)
  public class ApplicationData {
  
    private String name;
    private List&lt;Environment&gt; environments;
  
    // Getters and setters omitted
  }
  </code></pre>
  
  <p><strong><em>Environment.java</em></strong>  </p>
  
  <pre><code>public class Environment {
  
      private String id;
      private String name;
  
      // Getters and setters omitted
  }
  </code></pre>
  
  <p><strong><em>RestTemplate code</em></strong></p>
  
  <pre><code>List&lt;ApplicationData&gt; applications = new ArrayList&lt;&gt;();
  
  ResponseEntity&lt;List&lt;ApplicationData&gt;&gt; response =
    restTemplate.exchange("/deploy/project/all", HttpMethod.GET, null, 
    new ParameterizedTypeReference&lt;List&lt;ApplicationData&gt;&gt;() {});
  
  applications = response.getBody();
  </code></pre>