json_format

json_format(JsonDocument, FormatOptions)

The json_format formats the JsonDocument according to FormatOptions. Multiple options can be provided either space or comma separated.

Valid FormatOptions are:

  • COMPACT - remove all unnecessary whitespace

  • INDENT(N) - print the JSON with each object or array member on a new line, indented by N spaces to show structure

  • SORT-KEYS - sort the keys in the object. By default the order is preserved

  • EMBED - omit the enclosing {} or [] is using the snippet in another object

  • ENSURE_ASCII - encode all Unicode characters outside the ASCII range

  • ENCODE_ANY - if not a valid JSON document then encode into a JSON literal, e.g. to encode a string.

  • ESCAPE_SLASH - escape forward slash / as \/

Copyright © Thunderstone Software     Last updated: Oct 5 2023
Copyright © 2024 Thunderstone Software LLC. All rights reserved.