Hi everyone, I’m having some trouble with gson. I’...
# announcements
h
Hi everyone, I’m having some trouble with gson. I’m trying to parse a polymorphic list. In Java I would have a custom deserializer that determines the subtype based on a field value and then adds the element to the list using the appropriate type token of that subtype. When I ported this to Kotlin, I got class cast exceptions (apparently the list items are all of the supertype) and I had trouble registering my type adapter with gson (it would not execute during parsing). Any hint to the right direction (maybe a sample project) would be greatly appreciated!