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