FasterXML/jackson-module-mrbean — Issue #1: MrBean does not generate full generic type signatures (TypeReference + Nested Generics)
Author: cowtowncoder
Created: 2012-02-22 16:17:50+00:00
State: open

(moved from https://jira.codehaus.org/browse/JACKSON-479)
----
I would like to use ObjectMapper to read json into some interfaces that I have defined and am providing a TypeReference that has nested generic types such as the following:

TypeReference>

{'records':[{'breed':'Mountain Cur','name':'Fido'}],'total':1}

interface Results {
Long getTotal();

Set getRecords();
}

interface Dog {
String getName();

String getBreed();
}

In this example ObjectMapper materializes the json into a Results type object, containing a set of LinkedHashMaps instead of a set of the nested generic type (Dog in this example). I have attached a unit test that reproduces this behavior.