macro_rules! schema_for {
($type:ty) => { ... };
}
Generates a Schema
for the given type using default settings.
The type must implement [JsonSchema
].
use schemars::{schema_for, JsonSchema};
#[derive(JsonSchema)]
struct MyStruct {
foo: i32,
}
let my_schema = schema_for!(MyStruct);