pub trait ToJsonSchema {
// Required method
fn json_schema() -> JsonSchema;
}Expand description
Trait for types that can produce a JSON Schema.
Implemented for primitive/standard types (e.g. String, Option<T>) and for
structs via #[derive(ToJsonSchema)] with optional container/field attributes.
Required Methods§
Sourcefn json_schema() -> JsonSchema
fn json_schema() -> JsonSchema
Returns the JSON Schema for this type.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.