https://kotlinlang.org logo
#klaxon
Title
a

arve

11/07/2018, 9:33 AM
Trying to talk to an api which lists its users as a Map<String, UserObject>. Just realized that the object binding api (
Klaxon().parse()
) won't parse directly to maps. Example:
Copy code
val input = """{"hi" : "hello"}"""
val output = Klaxon().parse<Map<String, String>>(input) // com.beust.klaxon.KlaxonException: Couldn't find a suitable constructor for class Map to initialize with {}: null
Any suggestions?