-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Closed
Milestone
Description
I have the below class definition:
public class SomeClass {
private SomeType type;
@JsonTypeInfo(
visible = true,
use = JsonTypeInfo.Id.NAME,
include = JsonTypeInfo.As.EXTERNAL_PROPERTY,
property = "type")
@JsonSubTypes({
@JsonSubTypes.Type(value = SubType1.class, name = "subType1"),
@JsonSubTypes.Type(value = SubType2.class, name = "subType2"),
@JsonSubTypes.Type(value = SubType3.class, name = "subType3")
})
private final SuperType superType; //SuperType is abstract
//getters/setters
}
When attempting to deserialize, if I specify the wrong property, I receive the correct error stating:
Could not resolve type id 'string' into a subtype of [simple type, class SomeClass]: known type ids = [SuperType, subType1, subType2, subType3]
However, I want to know why my SuperType considered a known type id? Is there anyway to exclude it since it is an abstract class?
Metadata
Metadata
Assignees
Labels
No labels