Technical Notes: Java/JSON Polymorphic Mapping Using Jackson
Jackson has a number of flexible ways to map Java objects to and from JSON. Some of them are as follows:@JsonProperty
to change the name of the property output to JSON@JsonSerialize/@JsonDeserialize
to change the type of the object or to provide custom serializer@JsonIgnore
to ignore properties- Mixins to control runtime annotations during serialization & deserialization
Here in this post, I focus on serialization and deserialization of polymorphic types using
@JsonPropertyInfo
to inject an extra property called type to distinguish between different object types.Read full article from Technical Notes: Java/JSON Polymorphic Mapping Using Jackson
No comments:
Post a Comment