schemastore
Parse and match files against the SchemaStore catalog.
SchemaStore is a community-maintained collection of JSON Schema definitions for common configuration files. This crate deserializes the catalog and matches file paths to their corresponding schemas using the fileMatch glob patterns.
Usage
use ;
// Fetch the catalog JSON yourself (using reqwest, ureq, etc.)
// let json = reqwest::blocking::get(CATALOG_URL)?.text()?;
// let value: serde_json::Value = serde_json::from_str(&json)?;
// let catalog = parse_catalog(value)?;
// Example with inline data:
let value = json!;
let catalog = parse_catalog.unwrap;
let compiled = compile;
assert!;
API
CATALOG_URL— the well-known URL for theSchemaStorecatalog JSONparse_catalog(Value)— deserialize the catalog from aserde_json::ValueCompiledCatalog::compile(&Catalog)— pre-compile allfileMatchglobsCompiledCatalog::find_schema(path, file_name)— look up the schema URL for a file path
Catalog types (Catalog, SchemaEntry, etc.) live in the schema-catalog crate.
Bare filename patterns (e.g. tsconfig.json) are automatically expanded to also match nested paths (**/tsconfig.json). Negation patterns (starting with !) are skipped.
Design
This crate is #![no_std] — it only depends on alloc, serde, serde_json, and glob-match. No HTTP client is included; callers fetch the catalog JSON themselves.
License
Apache-2.0