Franco
05/21/2020, 4:33 AMtype is not registered for polymorphic serialization in the scope of class
This is my code:
@Serializable
sealed class TestClass {
@Serializable
@SerialName("TEST_1")
data class TestClass1(
val value1: String,
val value2: Int
) : TestClass()
@Serializable
@SerialName("TEST_2")
data class TestClass2(
val value1: String
) : TestClass()
}
I found this link where the issue is discussed: https://github.com/Kotlin/kotlinx.serialization/issues/457 and seems like a fix is ready (but not yet released).
I was wondering if there is a workaround that allows us to make it work until the fix is released? (I know that I can do this using a Serializer but not sure how to build it in a way that I can remove it once the fix for this is released and nothing will break).turansky
05/21/2020, 5:58 AMFranco
05/21/2020, 6:25 AM