1

I'm attempting to polymorphically deserialise objects from a nested JSON structure over which I have no control. I've been using

 @JsonTypeInfo(... include = JsonTypeInfo.As.EXTERNAL_PROPERTY, ...)

and

@JsonTypeInfo(... include = JsonTypeInfo.As.PROPERTY, ...)

with success but I've run into the case where the POJO type that I need to deserialise to is determined by a property which is an attribute of an object at a higher level.

From the JsonTypeInfo.As.EXTERNAL_PROPERTY Javadoc:

"Inclusion mechanism similar to PROPERTY, except that property is included one-level higher in hierarchy"

In my case the discriminating property is one level higher than this in the hierarchy.

Is there any way of doing this , or polymorphically desersialising based upon some extraneous data (not contained in the JSON itself)?

Thanks

user1061799
  • 95
  • 1
  • 3
  • 12
  • Have you checked [this](http://stackoverflow.com/q/12450404/823393)? – OldCurmudgeon Apr 17 '15 at 15:47
  • @OldCumudgeon - Thanks for that link and sorry for the late reply. I'll look into what you've done with reading the JSON tree. It could be doable but I was hoping that there might be some way to do this using already existing Jackson annotaions and such. – user1061799 Apr 21 '15 at 14:47

0 Answers0