Expand description
§jsonschema-explain
Render JSON Schema as human-readable terminal documentation
§Features
- Man-page-style terminal output from typed
jsonschema_schema::SchemaValueschemas - ANSI colors with bold headers, dimmed metadata, and highlighted types
- Syntax-highlighted code blocks in schema descriptions (via
markdown-to-ansi) - Renders properties, required fields, enums, defaults,
oneOf/anyOf/allOfvariants - Caller-provided width for terminal-aware layout
§Usage
use jsonschema_explain::{explain, ExplainOptions};
use jsonschema_schema::SchemaValue;
let schema: SchemaValue = serde_json::from_str(r#"{"type": "object"}"#).unwrap();
let opts = ExplainOptions { color: true, syntax_highlight: true, width: 120, validation_errors: vec![], extended: false };
let output = explain(&schema, "my-config", &opts);
println!("{output}");Part of the Lintel project.
§License
Apache-2.0
Structs§
- Explain
Error - A validation error to display in the VALIDATION ERRORS section.
- Explain
Options - Display options for rendering schema documentation.
Functions§
- explain
- Render a JSON Schema as human-readable terminal documentation.
- explain_
at_ path - Render a sub-schema at a given JSON Pointer path.
- navigate_
pointer - Walk a JSON Pointer path through a schema, resolving
$refat each step. - resolve_
schema_ ref - Resolve a
$refwithin the same schema document.