Skip to main content

write_schema

Function write_schema 

Source
pub fn write_schema(path: &Path) -> Result<()>
Expand description

Writes the JSON Schema to path as pretty-printed JSON.

§Errors

Returns an io::Error if the file cannot be created or written.

§Panics

Cannot panic in practice: generate_schema() builds a hand-authored serde_json::Value tree containing only strings, booleans, arrays and objects — no f32/f64 NaNs — which to_string_pretty cannot fail to serialize. The expect exists only to satisfy the type system without forcing callers to handle an unreachable Err.