devops_validate/schema/mod.rs
1//! JSON Schema registry and validation module.
2//!
3//! Provides offline-first schema resolution: bundled minimal schemas are
4//! embedded in the binary so validation works without network access.
5//! Remote schemas can be fetched separately and inserted via
6//! [`SchemaRegistry::cache_schema`].
7//!
8//! ## Architecture
9//!
10//! - [`registry`] — Schema URL mapping and in-memory cache
11//! - [`resolver`] — YAML type detection from parsed content
12//! - [`bundled`] — Embedded fallback schemas for offline mode
13//!
14//! ## Example
15//!
16//! ```rust
17//! use devops_validate::schema::SchemaRegistry;
18//!
19//! let mut registry = SchemaRegistry::new();
20//! let schema = registry.get_schema_sync("k8s/deployment").unwrap();
21//! let url = registry.get_schema_url("gitlab-ci").unwrap();
22//! assert!(url.contains("schemastore.org"));
23//! ```
24
25pub mod bundled;
26pub mod registry;
27pub mod resolver;
28
29pub use registry::{SchemaError, SchemaRegistry};
30pub use resolver::{YamlType, detect_type};