kotlin-json-stream

Kotlin-Multiplatform JSON stream serialization

APACHE-2.0 License

Stars
3
Committers
4

Kotlin Json Stream - Kotlin-Multiplatform JSON stream serialization

Dokumentation

This library is a kotlin-multiplatform streaming JSON-parser. It is based on OKIO for performance.

API-Docs

https://fab1an.github.io/kotlin-json-stream/

Example

fun test() {
    val json = JsonReader("""{"stringProp":"string", "intProp":0}""")

    json.beginObject()
    json.nextName() shouldEqual "stringProp"
    json.nextString() shouldEqual "string"
    json.nextName() shouldEqual "intProp"
    json.nextInt() shouldEqual 0
    json.endObject()
}
  
infix fun <T> T.shouldEqual(expected: T) {
    assertEquals(expected, this)
}