Expand description
Minimal JSON reader (doc 19, section 18.5).
Walks the text without building a tree: it can skip any value, hands out an object’s fields
as name → text-span pairs and decodes a JSON string. A message’s body is
any JSON, so the connector returns the text span without interpreting it.
Structs§
Constants§
- MAX_
DEPTH - Maximum nesting depth accepted; above it the document is refused instead of overflowing the stack.
Functions§
- array_
items - The items of a list, each one as a text span.
- decode_
string - Decodes a JSON string (
rawincludes the quotes): escapes,\uXXXXand surrogate pairs. - object_
fields - The fields of an object: decoded name and the text span of each value.
- pretty
- Re-indents a JSON document with two spaces, without touching the text of strings and numbers.
- quote
- Writes
sas a JSON string, in quotes. - skip_
value - Skips the value that starts at
start(after spaces) and returns the index right after it. - validate
- Checks that the whole of
sis a single valid JSON value (surrounding spaces are accepted).