I'm trying to serialize a `List` to JSON as value ...
# ktor
m
I'm trying to serialize a
List
to JSON as value for a key (
"items": [ {...}, {...} ]
) but I'm getting an array with no key instead (
[{...}, {...}]
). I'm using
ktor-serialization-kotlinx-json
, how can I change this behavior?
Copy code
@Serializable
data class Pages(val items: List<...>)

call.respond(listOf(...))
e
I'm not understanding why you're calling
respond(list)
and not
respond(Pages(list))
if you want it to be in the serialized output
m
oh, that was the mistake. It was serializing the list as an array because that was what I was passing
lmao
thx