Closed
Description
David Parks opened SPR-8381 and commented
HttpMessageConverter can't support conversion to typed collections.
Example: Use JacksonJsonMessageConverter to convert a json string to a Collection<Pojo> objects.
Since only a Class<? extends T> is specified, there's no way to declare both the type (Pojo.class) and the object (Collection.class).
Jackson classes support this using a TypeReference class (see: http://wiki.fasterxml.com/JacksonInFiveMinutes#Data_Binding_with_Generics)
Also, MappingJacksonJsonMessageConverter (line 104) is using a deprecated method of the current release of Jackson.
Affects: 3.0.5
Reference URL: http://stackoverflow.com/questions/6173182/spring-json-convert-a-typed-collection-like-listmypojo
Issue Links:
- Proper handling of parameterized types for @RequestBody parameters [SPR-9570] #14204 Proper handling of parameterized types for
@RequestBody
parameters ("is depended on by") - Proper handling of parameterized types in RestTemplate [SPR-7023] #11685 Proper handling of parameterized types in RestTemplate
- HttpMessageConverter#write should support typed collections [SPR-13467] #18046 HttpMessageConverter#write should support typed collections