toFormattedString
Encodes this JsonElement as a pretty-printed JSON string.
Extension function on JsonElement.
Return
the formatted JSON string
Parameters
indent
the indentation string to use (defaults to two spaces); it may contain only spaces, tabs, \r and \n, as kotlinx.serialization requires
Throws
if indent contains any other character
SerializationException
if this element holds NaN, Infinity, -Infinity or a number too large for a Double, which JSON cannot represent (see reformatJson)