prettyPrint

Specifies whether resulting JSON should be pretty-printed: formatted and optimized for human readability. false by default.

Example of usage:

@Serializable
class Key(val type: String, val opens: String)
val pretty = Json { prettyPrint = true }
/*
* Prints
* {
* "type": "keycard",
* "opens": "secret door"
* }
*/
println(pretty.encodeToString(Key("keycard", "secret door")))