![]() To work with multiple hierarchies, register it as a base class. : Serializer for FooBar can't be registered as a subclass for polymorphic serialization because its kind SEALED is not concrete. To work with multiple hierarchies, register it as a base class. First, we need to add the jackson-module-kotlin dependency to our pom.xml: The latest version of jackson-module-kotlin can be found on Maven Central. ![]() Serializer for FooBar can't be registered as a subclass for polymorphic serialization because its kind SEALED is not concrete. ![]() So, to deserialize it, I've defined Foo & Bar models respectively that inherit from FooBar parent, and written a JsonContentPolymorphicSerializer to choose the deserialization strategy accordingly, and finally I've registered this serializer in the `Json`'s SerializationModule but that results in the following exception being thrown at runtime: I have a part of json response that could look like this:
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |