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"));

Modules§

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

Structs§

SchemaRegistry
Schema registry with in-memory caching and bundled offline fallbacks.

Enums§

SchemaError
Error type for schema operations
YamlType
Supported YAML configuration types for schema-based validation.

Functions§

detect_type
Detect YAML type from parsed content.