<Deserializing a generic type using gson in kotlin...
# stackoverflow
u
Deserializing a generic type using gson in kotlin I have a generic type Animal implemented as a sealed class that can be a Dog or a Cat. sealed class Animal(val typeOfAnimal: String) { data class Dog(val barkVolume: Int): Animal("dog") data class Cat(val hasStripes: Boolean): Animal("cat") } According to http://jansipke.nl/serialize-and-deserialize-a-list-of-polymorphic-objects-with-gson/ you can deserialize an...