Skip to content

Latest commit

 

History

History
33 lines (25 loc) · 1.12 KB

README.md

File metadata and controls

33 lines (25 loc) · 1.12 KB

Kotlin Json Stream - Kotlin-Multiplatform JSON stream serialization

maven central version semver license build status OpenSSF Best Practices

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)
}