YAML Reference¶
Fathom's YAML authoring surface has one JSON Schema per construct.
Schemas are regenerated from fathom.models on every docs build.
Per-construct reference¶
| Construct | Page |
|---|---|
| Template | Template |
| Rule | Rule |
| Module | Module |
| Function | Function |
| Fact | Fact |
File-level keys¶
Each YAML file holds one kind of construct, named by its top-level key.
Any other top-level key is a CompilationError at load (parse_*_file,
Engine.reload_rules), an error from fathom validate, and an error
from POST /v1/compile:
| File | Allowed top-level keys |
|---|---|
| Template | templates |
| Module | modules, focus_order |
| Function | functions, hierarchies |
| Rule | ruleset, version, module, rules |
A mapping key given twice anywhere in a file (two expression: keys in
one condition, say) is invalid YAML to Fathom: every loader rejects it
instead of keeping the last value. Overriding a key merged in with <<
is not a duplicate.
A file with none of these keys (only unknown keys, {}, or a
focus_order with no modules) holds no construct: fathom compile,
fathom validate and POST /v1/compile all refuse it.
POST /v1/compile compiles a document through the same function as
fathom compile, so the two accept and refuse the same files, function
files included.
Downloads¶
| Construct | Schema |
|---|---|
| Template | template.schema.json |
| Rule | rule.schema.json |
| Module | module.schema.json |
| Function | function.schema.json |
| Hierarchy | schemas/hierarchy.schema.json |
See VSCode tooling for editor setup.