setLenient

fun setLenient(lenient: Boolean)

Configure this writer to relax its syntax rules. By default, this writer only emits well-formed JSON as specified by RFC 7159. Setting the writer to lenient permits the following:

  • Top-level values of any type. With strict writing, the top-level value must be an object or an array.
  • Numbers may be NaNs or infinities.