jsonschema-explain 0.3.0

Render JSON Schema as human-readable terminal documentation
Documentation

jsonschema-explain

Crates.io docs.rs GitHub License

Render JSON Schema as human-readable terminal documentation

Features

  • Man-page-style terminal output from typed jsonschema_schema::SchemaValue schemas
  • 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/allOf variants
  • 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