I’m trying to parse an array of json objects defin...
# klaxon
p
I’m trying to parse an array of json objects defined as
class Member(val id: String, val online: Boolean, val avatarUrl: String = "foo")
. The actual parse line is
Klaxon().parse<JsonArray<Member>>("""[{"id":"Perry","online":true,"avatarUrl":"asdf"}]""")
. This leads to
java.lang.ClassCastException: com.beust.klaxon.JsonArray cannot be cast to com.beust.klaxon.JsonObject: Ljava/lang/ClassCastException;
. If I change the parse line to be Klaxon().parse<Member> and remove the array, it works. Any ideas?