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