toJson

fun toJson(pretty: Boolean = false): String(source)

Creates a JSON string representation of the problem

This uses a rather naive, but dependency-free string builder approach to create standard application/json+problem representation. However, virtually any JSON library could be used on implementation side as well. As RFC7807 specifies the JSOn schema pretty well, no JSON library mappings like kotlinx-serialization or Jackson are provided.

Parameters

pretty

If true, output JSOn will be pretty-printed