Skip to main content

Module manifest_schema

Module manifest_schema 

Source
Expand description

#2096: the JSON Schema for bynk.toml, generated from the manifest’s Rust types.

The tables come from the crates that own them: [fmt] from bynk-fmt’s RawFmt (the struct that reads it), the rest from bynk_project::manifest_schema. The table list is bynk_project::MANIFEST_TABLES and bynk_project::MANIFEST_MAP_TABLES, the ones check_manifest_str refuses against, so a table added there without a schema fails generate, and the test holds every table’s keys to it.

The schema is committed at SCHEMA_PATH, under the docs site’s public/ directory, so the site serves it at SCHEMA_URL. cargo xtask manifest-schema rewrites it; tests/manifest_schema.rs fails when it is stale.

Constants§

SCHEMA_PATH
Where the schema is committed, relative to the repo root.
SCHEMA_URL
Where the docs site serves it: the schema’s $id, the URL the VS Code extension associates with bynk.toml, and the one a #:schema directive names.

Functions§

generate
The whole bynk.toml schema, keys sorted so the committed text is stable.
render
The schema as committed: pretty-printed, with a trailing newline.
write
Write the schema to SCHEMA_PATH under root.