Documentation
¶
Overview ¶
Command gen-schema emits a JSON Schema for the Ritefile format by reflecting on the public AST types in taskfile/ast. Run it with:
go run ./cmd/gen-schema > website/src/public/schema.json
or via the `gen:schema` task in Ritefile.yml. The schema is committed to the docs site so it can be served at clintmod.github.io/rite/schema.json.
The reflector does most of the work by walking tagged struct fields. For types that reflection can't handle — orderedmap wrappers (Vars, Tasks, Includes), types that accept multiple YAML shapes (Cmd, Dep, Task, Var, Prompt), and scalar-parsed types (Platform, Glob, *semver.Version) — we register custom Mapper overrides below.
Design note: we deliberately do NOT add JSONSchema() methods on AST types themselves; that would pull invopop/jsonschema into every downstream user of the library. All schema customization lives here.