Json5
Type-safe builder to create a custom Json5 instance.
To configure the returned instance (by specifying a custom SerializersModule or adjusting JSON5-specific settings), populate the ConfigBuilder object accordingly. The following example shows how to create and use a custom instance:
import io.github.xn32.json5k.Json5
import kotlinx.serialization.encodeToString
val json5 = Json5 {
prettyPrint = true
}
json5.encodeToString(listOf(10, 20, 30))
Content copied to clipboard
A detailed description of available settings can be found in the ConfigBuilder documentation.