Questions tagged [polymorphic-deserialization]
7 questions
3
votes
5 answers
Deserialize List of polymorphic objects into Object field
My REST endpoint returns Response object containing Object field. Everything is fine with serialization but when I started to write client for this API I encountered an issue with deserialization. I made this example code based on some…

Aleksandr Kravets
- 5,750
- 7
- 53
- 72
3
votes
1 answer
Jackson polymorphic deserialization of property using an existing sibling property value
I have an existing Request/Response protocol using JSON that I have no control over.
Example 1: response JSON not requiring any polymorphic deserialisation
{
"name" : "simple_response"
"params" : {
"success" : true
}
}
Example 2: response…

Farrukh Najmi
- 5,055
- 3
- 35
- 54
0
votes
1 answer
C# Polymorphic Deserialization of Bookmarks file
I am trying to deserialize a Bookmarks file. Specifically using polymorphic deserialization without Newtonsoft. When running I get an exception in the Read method of the converter class, at return for case "folder". It looks like I need some sort…
0
votes
0 answers
Polymorphic deserialization not working when deserializing appsettings.json
I have a base class Target and two derived classes TargetA and TargetB. From appsettings.json , I want to deserialize to the type of derived object (which can be either TargetA or TargetB at runtime).I'm using Polymorphic deserialization available…

Nin
- 11
- 5
0
votes
1 answer
Jackson @JsonSubTypes - Polymorphic deserialization with generics
I'm trying to deserialize this json body that I don't have any control over. Because the API I'm calling could provide different "data" (arrays of objects) depending on the "method" value, I thought of polymorphism and using @JsonSubTypes. However…

bob
- 198
- 1
- 10
0
votes
0 answers
Polymorphic type discriminator is not converted to enum during deserialization
I'm using enum field as type discriminator for polymorphic serialization/deserialization and faced strange behavior. A string value that is a type discriminator is not converted to enum and sets the default value of this enum.
Here's my C#…

Artur Safiullin
- 134
- 2
- 8
0
votes
2 answers
Polymorphic deserialization of nested list object in Kotlin
Trying to deserialize a pretty complex json string, I've done simpler ones but am struggling with how to set this up. I've also found some examples on simple polymorphic deserialization but cannot figure out how to adapt it for this more complex…

Monica
- 121
- 1
- 7