Skip to main content

Module json

Module json 

Source
Expand description

§Declarative JSON

A shape written back as the JSON that crate::expr::build reads: every string is an expression of the string DSL, a key expression ("a: String") carries its example as the value, and a "$$" key applies an expression to the object that holds it, with "$$0", "$$1", … beside it for the arguments an expression cannot spell inline (an object or array shape). The result reads back as the same shape: the JSON of the shape built from a shape’s JSON is that JSON, and the two accept and produce the same values. Nothing a function does can be written down, so a shape carrying one (a check function, a transform, a key function) cannot be written, nor can a builder option the DSL has no word for (rename’s keep and claim, refer’s fill and strict) or a default that is an object, an array or a date.

This mirrors ts/src/shape.ts nodeJson; the Go port carries the same.

Structs§

JsonError
What the JSON cannot say about a shape.

Functions§

node_json
The value form of a node: the JSON that reads back as it.