When using kotlinx serialization with ktor client and websockets I get
Copy code
Caused by: kotlinx.serialization.SerializationException: Can't locate argument-less serializer for class io.ktor.client.features.websocket.ClientWebSocketSession. For generic classes, such as lists, please provide serializer explicitly.
at kotlinx.serialization.PlatformUtilsKt.serializer(PlatformUtils.kt:28)
at io.ktor.client.features.json.serializer.KotlinxSerializer.lookupSerializer(KotlinxSerializer.kt:64)
at io.ktor.client.features.json.serializer.KotlinxSerializer.read(KotlinxSerializer.kt:55)
at io.ktor.client.features.json.JsonFeature$Feature$install$2.invokeSuspend(JsonFeature.kt:64)
at io.ktor.client.features.json.JsonFeature$Feature$install$2.invoke(JsonFeature.kt)
at io.ktor.util.pipeline.SuspendFunctionGun.loop(PipelineContext.kt:248)
... 31 more
e
e5l
12/02/2018, 5:26 AM
Hi, @jkbbwr. It’s probably a bug. Could you file an issue?
j
jkbbwr
12/02/2018, 6:05 AM
Not sure if it was. I got past it by fixing a different issue.
jkbbwr
12/02/2018, 6:05 AM
Long story short, I was hitting a non-ws endpoint in the ws then the renderer was trying to resolve the body to ClientWebSocketSession and dying