Schema generation now never returns an error

This commit is contained in:
Graham Esau 2019-10-19 20:33:26 +01:00
parent 8880fb3961
commit 5bf8b30753
18 changed files with 167 additions and 160 deletions

View file

@ -1,4 +1,4 @@
use schemars::{JsonSchema, schema_for};
use schemars::{schema_for, JsonSchema};
use serde::{Deserialize, Serialize};
#[derive(Deserialize, Serialize, JsonSchema)]
@ -20,7 +20,7 @@ struct Nested {
}
fn main() -> Result<(), Box<dyn std::error::Error>> {
let schema = schema_for!(MyStruct)?;
let schema = schema_for!(MyStruct);
println!("{}", serde_json::to_string_pretty(&schema)?);
Ok(())
}