Hello need a little help in IOS. Getting an error ...
# ktor
u
Hello need a little help in IOS. Getting an error -
failed with exception: kotlinx.serialization.SerializationException: Serializer for class 'List' is not found.
Please ensure that class is marked as '@Serializable' and that the serialization compiler plugin is applied.
Trying to parse a List of object
httpClient.get(url).body<List<Response?>?>()
JSON Response
Copy code
[
{"name" : "string"},
{"name" : "string"},
{"name" : "string"},
{"name" : "string"}
]
a
Can you tell me where the
List
is imported from?
u
kotlin.collections
a
Are able to receive and parse a serializable object (not a list)? Can you try to reproduce the problem without Ktor (just with the kotlinx.serialization framework)?
u
yes, getting bodyAsText and then further Json.decodefromstring works fine
a
Does it work to get a body without nullable types -
httpClient.get(url).body<List<Response>>()
?
u
no
a
Are you able to receive an object of some other type other than
List
?
u
yes
wrapping under a object
a
That's strange. Are you able to reproduce the same problem on Android?