1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
//! Schema canonicalization: reduce a JSON Schema to a normal form.
//!
//! Schemas accepting the same value set reduce to the *same* canonical schema.
//!
//! # Examples
//!
//! ```
//! use jsonschema::canonicalize;
//! use serde_json::json;
//!
//! let schema = canonicalize(&json!({"type": "integer", "minimum": 0})).unwrap();
//! assert_eq!(schema.to_json_schema(), json!({"type": "integer", "minimum": 0}));
//! ```
//!
//! # Entry points
//!
//! - [`canonicalize`](crate::canonicalize) / [`options`](fn@options) - canonicalize a schema (`options` configures
//! the draft and registry).
//! - [`CanonicalSchema`] - the result: emit with [`to_json_schema`](CanonicalSchema::to_json_schema), inspect with
//! [`view`](CanonicalSchema::view).
//! - [`CanonicalView`] - a total, match-once view of one canonical node for structural inspection.
pub
pub
pub
pub
pub
pub
pub
pub use CanonicalizationError;
pub use ;
pub use CanonicalSchema;
pub use ;
pub use DefinitionMap;