toMap

fun JsonElement.toMap(): Map<String, *>

Convert a JsonElement to a Map so it's compatible with QueryStringFactory. Note that this only supports JsonObjects currently. Other types will result in an InvalidSerializationException.


fun JsonObject.toMap(): Map<String, *>

Convert a JsonObject to a Map so it's compatible with QueryStringFactory.

Adapted from https://stackoverflow.com/questions/44870961/how-to-map-a-json-string-to-kotlin-map