Generate JSON Schema from Rust types with Schemars
masterSchemars allows you to generate JSON Schema documents from Rust data structures using the JsonSchema trait. It is designed to be compatible with Serde, meaning it respects #[serde(...)] attributes to ensure the generated schema matches how serde_json would serialize or deserialize the data.
To use it, any type you want to describe must implement the JsonSchema trait. Schemars provides implementations for many standard library types and offers a derive macro for custom types.