I wrote a deserializer for a List of type Any `Lis...
# serialization
i
I wrote a deserializer for a List of type Any
List<Any>
and it works fine when I try to encode/decode the list on it’s own with
Json
When I added it to my class, which is a member of a sealed class, I get this error.
Serializer has not been found for type 'Any'. To use context serializer as fallback, explicitly annotate type or property with @Contextual
Copy code
@Serializable
    @SerialName("Sign")
    data class Sign(
        @Serializable(with = ListAnySerializer::class)
        val payload: List<Any>
    ) : SealedClass()
a
You should create a serialize of type
Any
instead of creating a serializer of type
List<Any>