pub fn json_schema() -> StringExpand description
The JSON Schema an editor completes preset TOML from, as committed to
presets/preset.schema.json and associated with preset files by .taplo.toml.
A second rendering of the declarations document prints, not a second
copy of them: the structural half walks TABLES, the parameter half walks
SystemKind::param_specs and GLOBAL_PARAMS, and neither writes a name
or a roster of its own. core/tests/suite/preset_schema.rs holds the committed file
to this function and validates the whole preset corpus against the same
declarations — so the file, the editor and the loader cannot disagree about
what a preset may contain.
Draft-07, because that is what Even Better TOML’s Taplo backend implements —
in particular the if/then the per-system parameter sets need.
This file validates and does not complete. Taplo reads hover text and
completions only off unconditional properties, so a [params] key inside one
of the if/then cases below gets neither. It is the fallback .taplo.toml
applies to a file no family rule claims; system_json_schema is what a
library file named for its family gets.
§What it does and does not enforce
additionalProperties: false appears only where the engine’s declaration
is authoritative for the whole key set: the document root, each structural
table, and each system’s [params]. It is deliberately absent from the
author-keyed maps — [smoothing], [hold], [occupancy], [latch] — whose
keys the preset chooses.
No range is enforced anywhere. ParamSpec::range is documented as
neither a clamp nor a validation bound, and presets set a value outside it on
purpose; a range that underlined a correct preset would be worse than no range
at all. It is carried as prose in markdownDescription, where an author reads
it and nothing acts on it.
Every [params] value is type: string: a binding is an expression, and
glow = 1.0 is a load error rather than a shorthand.