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.

EricSchaefer
  • 25,272
  • 21
  • 67
  • 103
yeshas
  • 81
  • 5
  • You could always refactor the bulk of `TestProfile` into a parent class that does not have the `@JsonTypeInfo` annotation, and use that as your deserialization target. Are you trying to unmarshal 'legacy' data? – Perception Jun 07 '13 at 00:57

0 Answers0