jsonbuilder

jsonbuilder allows to build json using an idiomatic kotlin builder DSL

Лицензия

Лицензия

Категории

Категории

JSON Данные
Группа

Группа

com.github.holgerbrandl
Идентификатор

Идентификатор

jsonbuilder
Последняя версия

Последняя версия

0.9
Дата

Дата

Тип

Тип

pom.sha512
Описание

Описание

jsonbuilder
jsonbuilder allows to build json using an idiomatic kotlin builder DSL
Ссылка на сайт

Ссылка на сайт

https://github.com/holgerbrandl/jsonbuilder
Система контроля версий

Система контроля версий

https://github.com/holgerbrandl/jsonbuilder.git

Скачать jsonbuilder

Зависимости

compile (2)

Идентификатор библиотеки Тип Версия
org.json : json jar 20200518
org.jetbrains.kotlin : kotlin-stdlib jar 1.4.31

Модули Проекта

Данный проект не имеет модулей.

jsonbuilder for Kotlin

jsonbuilder is a small artifact that serves a single purpose: It allows to create json using an idiomatic kotlin builder DSL.

Example

val myJson = json {
        "size" to 0
        "array" to arrayOf(1,2,3)
        "aggs" to {
            "num_destinations" to {
                "cardinality" to {
                    "field" to "DestCountry"
                }
            }
        }
    }

which will result in the following json structure:

{
  "size": 0,
  "array": [
    1,
    2,
    3
  ],
  "aggs": {
    "num_destinations": {
      "cardinality": {
        "field": "DestCountry"
      }
    }
  }
}

Both arrays and nested elements are supported without additional functions/constructs.

Setup

Gradle

To get started simply add it as a dependency in your build.gradle:

compile "com.github.holgerbrandl:jsonbuilder:0.9"

Development Snapshots

You can also use JitPack with Maven or Gradle to build the latest snapshot as a dependency in your project.

repositories {
    maven { url 'https://jitpack.io' }
}
dependencies {
        compile 'com.github.holgerbrandl:jsonbuilder:-SNAPSHOT'
}

How to build?

To build and install it into your local maven cache, simply clone the repo and run

./gradlew install

Documentation

This README.md. Feel welcome to file tickets about missing pieces in the docs.

How to contribute?

Feel welcome to post ideas, suggestions and criticism to our tracker.

We always welcome pull requests. :-)

You could also show your spiritual support by just upvoting jsonbuilder here on github.

References

This library is built using https://github.com/stleary/JSON-java

Other references

Версии библиотеки

Версия
0.9