vert-x3 / vertx-lang-kotlin

Vert.x for Kotlin
Apache License 2.0
296 stars 68 forks source link

Fix example in documentation #219

Closed MarkMarkyMarkus closed 2 years ago

MarkMarkyMarkus commented 2 years ago

Motivation:

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()
    )
  }
vietj commented 2 years ago

thanks