Expand description
Garde rules every declared schema shares. Garde rules every declared schema shares, so a repository’s config and a template’s own exports are held to the same rules and complain the same way.
Each one is a #[garde(custom(…))] rule: it runs at the boundary, on a
fully parsed value, and garde names the field that failed. They are generic
over the context, so the same rule works in a schema validated against
nothing and in one validated against the whole document.
Functions§
- at_
least_ one - A list a schema needs something in, complaining in the repository’s own
words:
at_least_one("label")says “must declare at least one label”. - cannot_
be_ empty - A value a schema cannot do without, told what it is for, so the complaint reads like a sentence: “cannot be empty — it is what marks a template”.
- inside_
the_ repo - Somewhere a repository may write: relative, and never upward out of the
tree. A rooted path without a drive (
\xon Windows) or a drive-relative one (C:x) is not absolute, yet joining it replaces the repository root, so any root or prefix component is refused too. - one_
file_ name - One file name, so a name cannot smuggle in the path it was separated from.