Programmer Bruce: Deserialize JSON with Jackson into Polymorphic Types - A Complete Example
Example 6: Simple Deserialization Without Type Element To Container Object With Polymorphic Collection
Some real-world JSON APIs have polymorphic type members, but don't include type elements (unlike the JSON in the previous examples). Deserializing such sources into polymorphic collections is a bit more involved. Following is one relatively simple solution. (This example includes subsequent serialization of the deserialized Java structure back to input JSON, but the serialization is relatively uninteresting.)
Read full article from Programmer Bruce: Deserialize JSON with Jackson into Polymorphic Types - A Complete Example
No comments:
Post a Comment