title: Parse anonymous array from JSON result with Google HTTP Client Library
body: <p>My REST service respons with the following data:</p>
  
  <pre><code>[
      {
          "name": "Bart",
          "age": 10
      },
      {
          "name": "Homer",
          "age": 42
      },
      {
          "name": "Marjorie",
          "age": 34
      }
  ]
  </code></pre>
  
  <p>The result set is an array of objects which I want to automatically parse with Google's HTTP Client library. Therefore I created a <code>SimpsonResult</code> and <code>Simpson</code> class:</p>
  
  <p><strong>SimpsonResult.java</strong></p>
  
  <pre><code>public class SimpsonResult {
  
    private List&lt;Simpson&gt; simpsons;
  
    public SimpsonResult() {
    }
  
    public List&lt;Simpson&gt; getSimpsons() {
      return simpsons;
    }
  
    public void setSimpsons(List&lt;Simpson&gt; simpsons) {
      this.simpsons = simpsons;
    }
  
  }
  </code></pre>
  
  <p><strong>Simpson.java</strong></p>
  
  <pre><code>public class Simpson {
  
    @Key
    private String name;
  
    @Key
    private int age;
  
    public Simpson() {
    }
  
    public String getName() {
      return name;
    }
  
    public void setName(String name) {
      this.name = name;
    }
  
    public int getAge() {
      return age;
    }
  
    public void setAge(int age) {
      this.age = age;
    }
  
  }
  </code></pre>
  
  <p>Now I want to query my backend and automatically map the response into a <code>SimpsonResult</code>. Therefore I wrote the following code:</p>
  
  <pre><code>@Override
  public SimpsonResult loadDataFromNetwork() throws IOException {
    HttpRequestFactory requestFactory = getHttpRequestFactory();
    GenericUrl url = new GenericUrl(baseUrl);
    HttpRequest request = requestFactory.buildGetRequest(url);
    request.setParser(new JacksonFactory().createJsonObjectParser());
    return request.execute().parseAs(SimpsonResult.class);
  }
  </code></pre>
  
  <p>But when I execute the code, then I get a parser exception from <code>com.google.api.client.json.JsonParser</code>. </p>
  
  <p>When I map it into a string (<code>request.execute().parseAsString()</code>), then it works.</p>
  
  <p>So I think that my mapping declaration is wrong? </p>