https://kotlinlang.org logo
#serialization
Title
# serialization
z

zt

02/19/2023, 11:37 PM
I'm getting the error
Caused by: kotlinx.serialization.json.internal.JsonDecodingException: Polymorphic serializer was not found for missing class discriminator ('null')
I know that the type field in my json data is missing, however I set up a default deserializer for it.
Copy code
polymorphicDefaultDeserializer(ApiNext.Renderer.ItemSection::class) {
  ApiNext.Renderer.Separator.serializer()
}
This should work, but it throws that error. ItemSection is a sealed interface Seperator is just a serializable object that inherits from it
32 Views