title: How to consume REST in Spring/Java with JSON unnamed values?
body: <p>I am new to JSON and REST. I am using Spring's RestTemplate to consume JSON. I was able to do it with this JSON response with this API call: <a href="http://data.fcc.gov/api/block/find?latitude=39.9936&amp;longitude=-105.0892&amp;showall=false&amp;format=json" rel="nofollow">http://data.fcc.gov/api/block/find?latitude=39.9936&amp;longitude=-105.0892&amp;showall=false&amp;format=json</a></p>
  
  <p>JSON Response:</p>
  
  <pre><code>    {"Block":{"FIPS":"080130608005010"},"County":
      {"FIPS":"08013","name":"Boulder"},"State":
      {"FIPS":"08","code":"CO","name":"Colorado"},"status":"OK","executionTime":"8"}
  </code></pre>
  
  <p>However, when I take this FIPS code from this request and try to use it to request information from the census with this call: <a href="http://api.census.gov/data/2012/acs5?get=B19001_002E&amp;for=tract:060800&amp;in=state:08+county:013&amp;key=" rel="nofollow">http://api.census.gov/data/2012/acs5?get=B19001_002E&amp;for=tract:060800&amp;in=state:08+county:013&amp;key=</a></p>
  
  <p>This is the JSON Response I get: </p>
  
  <pre><code>    [["B19001_002E","state","county","tract"],
      ["225","08","013","060800"]]
  </code></pre>
  
  <p>As you can see all of the 'variables' are unnamed and in arrays. I am not sure how to consume this using Spring's RestTemplate using a POJO.</p>
  
  <p>This is the Java code I have (where URL is the string of the API Call):</p>
  
  <pre><code>RestTemplate restTemplate = new RestTemplate();
  CensusData cd = restTemplate.getForObject(URL, CensusData.class);
  System.out.println("data: " + cd.getData());
  </code></pre>
  
  <p>Here is my POJO (CensusData):</p>
  
  <pre><code>@JsonIgnoreProperties(ignoreUnknown = true)
  public class CensusData {
  
       @JsonProperty
      private List&lt;List&lt;String&gt;&gt; data;
  
      public String getData() {
          String str = "";
          for(List&lt;String&gt; list : data) {
              for(String s : list) {
                  str += s;
                  str += " ";
              }
          }
          return str;
      }
  }
  </code></pre>
  
  <p>The problem is that I don't know what to name "data" in my CensusData object, since the values are unnamed in the JSON response. So I get this exception thrown:</p>
  
  <pre><code>Exception in thread "main" org.springframework.http.converter.HttpMessageNotReadableException: Could not read JSON: Can not deserialize instance of template.main.CensusData out of START_ARRAY token
  </code></pre>