您需要执行以下操作:
public class CountryInfoResponse { @JsonProperty("geonames") private List<Country> countries; //getter - setter}RestTemplate restTemplate = new RestTemplate();List<Country> countries = restTemplate.getForObject("http://api.geonames.org/countryInfoJSON?username=volodiaL",CountryInfoResponse.class).getCountries();如果您可以使用某种注释来跳过级别,那将是很好的选择,但尚不可能(请参阅this和this)


![无法读取JSON:无法从START_OBJECT令牌中反序列化hello.Country []的实例 无法读取JSON:无法从START_OBJECT令牌中反序列化hello.Country []的实例](http://www.mshxw.com/aiimages/31/446669.png)
