Bonjour, I’m using ktor-client with content-negoci...
# ktor
j
Bonjour, I’m using ktor-client with content-negociation powered by kotlinx-serialization.
httpResponse.body<List<T>>()
fails on me with this error Expected class kotlinx.serialization.json.JsonObject as the serialized body of kotlinx.serialization.Polymorphic<List>, but had class kotlinx.serialization.json.JsonArray I tried to read the docs but they only speak about deserializing json objects. Are json arrays being supported?
b
Copy code
val body: List<Int> = response.body()
You can deserialize to list such response
Copy code
[
  123,
  456
]
But you are using generic i think and you have problem there