gen-schema

command
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 14, 2026 License: MIT Imports: 8 Imported by: 0

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL