There is an example of json builder in the documentation. It doesn't even compile, there should be obj() wrapper.
@Test
fun testJsonBlock() {
val result = json {
obj(
"firstName" to "Dale",
"lastName" to "Cooper",
"age" to 64,
"names" to array("Dale", "Bartholomew")
)
}
assertEquals(
"""{"firstName":"Dale","lastName":"Cooper","age":64,"names":["Dale","Bartholomew"]}""",
result.toString()
)
}
Motivation:
There is an example of
json
builder in the documentation. It doesn't even compile, there should beobj()
wrapper.