Suppose serialization in json includes the class name for the actual object using this annotation in the class:
@JsonTypeInfo(use = JsonTypeInfo.Id.CLASS, include = JsonTypeInfo.As.PROPERTY, property = "@type") class MyClass { String foo; }
So for example json:
{"@type": "com.example.MyClass", "foo": "bar"}
Can this be deserialized without specifying a type? And I mean even the super type. Just something like:
objectMapper.readValue(value, Object.class);
which actually doesn't work, it returns the card.
java json jackson
Nazaret K.
source share