8

Here is my Class with JSON Annotation

@JsonIgnoreProperties(ignoreUnknown = true)
@XmlRootElement
@Entity
@JsonTypeInfo(use=org.codehaus.jackson.annotate.JsonTypeInfo.Id.CLASS, include=As.PROPERTY, property="class")

public class TestProfile implements Serializable,JsonSerializable
{ -------------- }

i am trying to deserialize the JSON string into the above class. It fails with the exception below

"Unexpected token (END_OBJECT), expected FIELD_NAME: missing property 'class' that is to contain type id".

the class field is not present in the json string.

How do I ignore only @JsonTypeInfo annotation?

Settings DeserializationConfig.Feature.USE_ANNOTATIONS to ignore all annotaions is not helping.

4

0 回答 0