buildJsonObject

inline fun buildJsonObject(builderAction: JsonObjectBuilder.() -> Unit): JsonObject(source)

Builds JsonObject with the given builderAction builder. Example of usage:

val json = buildJsonObject {
put("booleanKey", true)
putJsonArray("arrayKey") {
for (i in 1..10) add(i)
}
putJsonObject("objectKey") {
put("stringKey", "stringValue")
}
}