Skip to main content

read_schema_dir

Function read_schema_dir 

Source
pub fn read_schema_dir(dir: &Path) -> Result<Vec<(String, Value)>, Error>
Expand description

Every <vendor>/<name>/<name>.v<n>.schema.json under a schema root, parsed, keyed by the schema identity its path derives (majordomus.adr/v1) and sorted by it. A root that does not exist yields nothing; that is the repository’s case when it adds no schema of its own.

The identity and the path fix each other, so a schema can be found from a kinds.yaml entry without a directory scan and a file cannot quietly answer to a name it does not declare. A file whose path does not have the shape is refused by name rather than skipped, because a schema nobody loads validates nothing and says so nowhere.