commonTest.kotlinx.serialization.json.JsonTreeImplicitNullsTest.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of kotlinx-serialization-json
Show all versions of kotlinx-serialization-json
Kotlin multiplatform serialization runtime library
package kotlinx.serialization.json
import kotlinx.serialization.KSerializer
class JsonTreeImplicitNullsTest: AbstractJsonImplicitNullsTest() {
override fun Json.encode(value: T, serializer: KSerializer): String {
return encodeToJsonElement(serializer, value).toString()
}
override fun Json.decode(json: String, serializer: KSerializer): T {
val jsonElement = parseToJsonElement(json)
return decodeFromJsonElement(serializer, jsonElement)
}
}