Re: [jackson-user] Custom deserializing Map<String, Foo> where Foo is polymorphic

2017-02-22 Thread David Corbin
Well, I solved it. It turns out that JsonParser#currentName() has what i needed. That allows me to select the class it should be, and then I could use a few of the objects hanging off the arguments to have Jackson deserialize the tree with the correctly class. Naturally, I found it about 10

Re: [jackson-user] Custom deserializing Map<String, Foo> where Foo is polymorphic

2017-02-20 Thread Tatu Saloranta
Almost but not quite. Use of `@JsonTypeInfo(include=As.WRAPPER_OBJECT)` would indeed allow use of JSON property name as type identitifier. This would work for property values, and Lists/Arrays, but not quite the way you'd want for Maps. So if I understand use case correctly, there is nothing out

[jackson-user] Custom deserializing Map<String, Foo> where Foo is polymorphic

2017-02-19 Thread David Corbin
Foo is an interface, with several varied concrete classes. I do not have type information imbedded in the objects, but based on the key of the map, I can tell you the concrete type. Do, I have something like this in json: { "id" : "12", "elements" : { "alpha" : { "host" :