Json

fun Json(from: Json = Json.Default, builderAction: JsonBuilder.() -> Unit): Json(source)

Creates an instance of Json configured from the optionally given Json instance and adjusted with builderAction.

Example of usage:

val defaultJson = Json {
encodeDefaults = true
ignoreUnknownKeys = true
}
// Will inherit the properties of defaultJson
val debugEndpointJson = Json(defaultJson) {
// ignoreUnknownKeys and encodeDefaults are set to true
prettyPrint = true
}