An implementation of Rison. This is kotlin porting of python-rison based on kotlinx.serialization
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)
}
see python-rison
- Rison original website: http://mjtemplate.org/examples/rison.html (archive)
- python-rison (outdated) : last update is 2015.
- python-rison:
forked from the above and updated for Python 3 compatibility. This project
rison.kt
is the poring of this. - rison(java): A Rison plugin for Jackson
- rison(JavaScript/Python/ect)