Skip to main content

Module schema

Module schema 

Source
Expand description

JSON Schema registry and validation module.

Provides offline-first schema resolution: bundled minimal schemas are embedded in the binary so validation works without network access. Remote schemas can be fetched separately and inserted via SchemaRegistry::cache_schema.

§Architecture

  • registry — Schema URL mapping and in-memory cache
  • resolver — YAML type detection from parsed content
  • bundled — Embedded fallback schemas for offline mode

§Example

use devops_validate::schema::SchemaRegistry;

let mut registry = SchemaRegistry::new();
let schema = registry.get_schema_sync("k8s/deployment").unwrap();
let url = registry.get_schema_url("gitlab-ci").unwrap();
assert!(url.contains("schemastore.org"));

Re-exports§

pub use registry::SchemaError;
pub use registry::SchemaRegistry;
pub use resolver::YamlType;
pub use resolver::detect_type;

Modules§

bundled
Bundled fallback schemas for offline mode
registry
Schema registry for fetching and caching JSON Schemas
resolver
YAML type detection from content