How can I configure Ktor to use a custom serialize...
# ktor
z
How can I configure Ktor to use a custom serializers module during content negotiation, specifically for a polymorphic type? Something simple like
Copy code
val serializerModule = SerializersModule {
    polymorphic(Person::class) {
        subclass(SerializablePerson::class)
    }
}
r
I suppose you already know, but that's how it is if you haven't done it yet.
Copy code
HttpClient {
            install(ContentNegotiation) {
                json(
                    Json {
                        serializersModule = SerializersModule {
                            // do your thing
                        }
                    }
                )
            }
}
z
Ah, I didn't even see that property for some reason. I'll give it a shot
Works perfectly, thank you!