1 2 3 4 5 6 7 8 9 10
use schemars::{schema_for, schema::Schema}; use std::error::Error; fn main() -> Result<(), Box<dyn Error>> { let schema = schema_for!(Schema)?; let json = serde_json::to_string_pretty(&schema)?; println!("{}", json); Ok(()) }