pub struct SchemaDocument { /* private fields */ }Expand description
Fully resolved JSON Schema document.
Implementations§
Source§impl SchemaDocument
impl SchemaDocument
Sourcepub fn from_json(raw: &Value) -> Result<Self, AstError>
pub fn from_json(raw: &Value) -> Result<Self, AstError>
Build a resolved schema document from raw JSON Schema.
The resolved graph is built from the canonicalized schema so
compatibility analysis and generation can consume a deterministic IR,
while is_valid() intentionally validates against a backend compiled
from the original raw schema document.
Sourcepub fn root(&self) -> Result<&SchemaNode, AstError>
pub fn root(&self) -> Result<&SchemaNode, AstError>
Return the lazily built resolved root node.
This is the low-level extension point for crates that need the resolved
IR, such as jsoncompat and json_schema_fuzz. Validation callers
should prefer SchemaDocument::is_valid.
Sourcepub fn canonical_schema_json(&self) -> Result<&Value, AstError>
pub fn canonical_schema_json(&self) -> Result<&Value, AstError>
Return the canonicalized JSON Schema document used to build root().
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for SchemaDocument
impl !RefUnwindSafe for SchemaDocument
impl !Send for SchemaDocument
impl !Sync for SchemaDocument
impl Unpin for SchemaDocument
impl UnsafeUnpin for SchemaDocument
impl !UnwindSafe for SchemaDocument
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more