Skip to content

Foxcapades/KJack

Repository files navigation

Kotlin DSL for Jackson

jvm 1 kotlin 1.6 Maven Central

Provides a Kotlin overlay over FasterXML Jackson adding json constructing methods using Kotlin lambdas.

Additionally, corrects and adds functionality over the Jackson API, such as adding support for unsigned types or correcting the fact that a generic type is required for any untyped call to ObjectNode's set method.

Source
objectNode {
  put("foo", "value")
  addObject("bar") {
    addArray("fizz") {
      add(1, 2, 3)
    }
  }
}
Output
{
  "foo": "value",
  "bar": {
    "fizz": [1, 2, 3]
  }
}