Skip to main content

Crate schema_catalog

Crate schema_catalog 

Source
Expand description

§schema-catalog

Crates.io docs.rs CI License

Types for the JSON Schema catalog format (schema-catalog.json), compatible with SchemaStore.

Part of the Lintel project.

§Usage

use schema_catalog::{Catalog, parse_catalog};

let json = r#"{"version":1,"schemas":[{"name":"Example","description":"An example schema","url":"https://example.com/schema.json","fileMatch":["*.example.json"]}]}"#;
let catalog: Catalog = parse_catalog(json).unwrap();
assert_eq!(catalog.schemas[0].name, "Example");

§License

Apache-2.0

Structs§

Catalog
Schema catalog index that maps file patterns to JSON Schema URLs.
CatalogGroup
A group of related schemas in the catalog.
SchemaEntry
A single schema entry in the catalog.

Functions§

parse_catalog
Parse a catalog from a JSON string.
parse_catalog_value
Parse a catalog from a serde_json::Value.
schema
Generate the JSON Schema for the Catalog type.