But how would RestTemplate know to convert list items into class instances Foo? Have you tried to run the code and does it work as expected?
One way that I can think of all this is to use an array as the input type. eg.
restTemplate.getForObject(restServiceURI, Foo[].class);
But I do not know if this was supported. If you really need to deserialize more complex data types, you should consider using Jackson or Gson.
With Jackson, you can use the ObjectMapper class to easily deserialize data from most sources.
String input = ...;
ObjectMapper mapper = new ObjectMapper();
List<Foo> list = mapper.readValue(input, new TypeReference<List<Foo>>(){});
, , TypeReference, , mapper Foo. .