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:@JsonPropertyto change the name of the property output to JSON@JsonSerialize/@JsonDeserializeto change the type of the object or to provide custom serializer@JsonIgnoreto 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