Skip to main content

Module json

Module json 

Source
Expand description

JsonEvents/1 as JSON text.

The renderer writes what it is given, in the order it is given, with nothing held back but the separators: a comma is written when the next item begins, never speculatively, so an aborted document is still a prefix of a valid one. Compact output is the standard profile; a fixed indent is a separate profile for people rather than programs, and the two differ only in whitespace. Strings are escaped as RFC 8259 requires and no more: ", \, and the control characters, with everything else, non-ASCII included, written as itself, because the output is UTF-8 and an escape would only make it longer.

The renderer validates the event sequence as it goes, because a third-party source is as much a source of JsonEvents/1 as the standard ones are: one root value, keys only where a member begins, balanced containers, one end.

Structs§

JsonOptions
The JSON profile, which is one of alchemy’s shared types. The JSON profile.
JsonRenderer
Renders JsonEvents/1 as JSON text.