Schema generation now never returns an error
This commit is contained in:
parent
8880fb3961
commit
5bf8b30753
18 changed files with 167 additions and 160 deletions
|
@ -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(())
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue