sealed class child, that will be a fallback when all other classes don't match?
(With annotations only? I know I can have a custom serializer a wire it up manually)
Copy code
@Serializable
sealed class Item {
@SerialName("A")
@Serializable
data class ChildA(..) : Item()
@Serializable
data class Unknown : Item() <--------
}
m
Michael Krussel
09/18/2025, 10:56 AM
You need to specify a default deserializer in the module.