Hi everyone :wave: I have an api service which res...
# serialization
s
Hi everyone 👋 I have an api service which responds with a list of Item objects:
suspend fun fetch(): List<Item>
. I would like to register a custom serializer for this list of items. Something like:
Copy code
val format = Json {
    serializersModule = SerializersModule {
        contextual(List<Item>::class, CustomListSerializer(Item.serializer()))
    }
}
I have also tried
suspend fun fetch(): @Serializable(with = CustomListSerializer::class) List<Item>
but this also does not work. Any pointers would be helpful 🙏