Skip to content

emesday/rison.kt

Repository files navigation

rison.kt

An implementation of Rison. This is kotlin porting of python-rison based on kotlinx.serialization

Quickstart

import emesday.rison.*
import kotlinx.serialization.*

@Serializable
data class Project(val name: String, val language: String)

fun main() {
    val projectAsRisonString = Rison.encodeToString(Project("kotlinx.serialization", "Kotlin"))
    println(projectAsRisonString)
    // (language:Kotlin,name:kotlinx.serialization)
    val project = Rison.decodeFromString<Project>("(language:Kotlin,name:kotlinx.serialization)")
    println(project)
    // Project(name=kotlinx.serialization, language=Kotlin)
}

Rison - Compact Data in URIs

see python-rison

Related Projects

About

Rison for Kotlin

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages