android – kotlinx.serialization.json.internal.JsonDecodingException: Polymorphic serializer was not found for missing class discriminator (‘null’)

I am using sealed class to handle api response. I am trying some code but getting some error of serialization. I tried this solution as well but it did not work. Can you guys help me out on this problem. I am new in serialization field. import kotlinx.serialization.Serializable sealed class ApiResponse<out T : Any> { … Read more