commonMain.com.copperleaf.ballast.debugger.versions.v1.ClientModelSerializerV1.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ballast-debugger-server-jvm Show documentation
Show all versions of ballast-debugger-server-jvm Show documentation
Ktor websocket server for building Ballast Debugger UI
package com.copperleaf.ballast.debugger.versions.v1
import com.copperleaf.ballast.debugger.versions.ClientModelSerializer
import kotlinx.serialization.json.Json
public class ClientModelSerializerV1 : ClientModelSerializer {
private val debuggerEventJson: Json = Json {
isLenient = true
}
override val supported: Boolean = true
override fun mapIncoming(incoming: String): BallastDebuggerEventV1 {
return debuggerEventJson
.decodeFromString(BallastDebuggerEventV1.serializer(), incoming)
}
override fun mapOutgoing(outgoing: BallastDebuggerActionV1): String {
return debuggerEventJson
.encodeToString(BallastDebuggerActionV1.serializer(), outgoing)
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy