Assume serialization to json includes the class name of the actual object, using this annotation on the Class:
@JsonTypeInfo(use = JsonTypeInfo.Id.CLASS, include = JsonTypeInfo.As.PROPERTY, property = "@type")
class MyClass {
String foo;
}
So json is for example:
{"@type": "com.example.MyClass", "foo": "bar"}
Can this be deserialized without specifying the type? And I mean not even the super type. Just something like:
objectMapper.readValue(value, Object.class);
which doesn't actually work, it brings back a Map.