Polymorphism without serialized type info (with example) - Jackson JSON User Group
I am wondering if type info has to be included in the json to deserialize collections when using annotation @JsonDeserialize(contentAs=SomeConcreteClass.class) .... where the collection would be a Collection<InterfaceClass> and SomeConcreteClass implements InterfaceClass. Is it because even though I specified the templated class, the type of collection is still unknown (e.g. ArrayList vs HashSet)? I want the json to be natural and as small a size as possible, and to be able to easily and explicitly annotate what type an object should be deserialized as. Example classes:
Read full article from Polymorphism without serialized type info (with example) - Jackson JSON User Group
No comments:
Post a Comment