Expand description
Generate JSON Schema from facet type metadata.
This crate uses facet’s reflection capabilities to generate JSON Schema definitions
from any type that implements Facet.
§Example
use facet::Facet;
use facet_json_schema::to_schema;
#[derive(Facet)]
struct User {
name: String,
age: u32,
email: Option<String>,
}
let schema = to_schema::<User>();
println!("{}", schema);Structs§
- Json
Schema - A JSON Schema definition.
Enums§
- Additional
Properties - Additional properties can be a boolean or a schema
- Schema
Type - JSON Schema type
Functions§
- schema_
for - Generate a JSON Schema from a facet type.
- to_
schema - Generate a JSON Schema string from a facet type.