Crates.io | facet-jsonschema |
lib.rs | facet-jsonschema |
version | 0.28.0 |
created_at | 2025-04-25 15:28:26.333167+00 |
updated_at | 2025-07-25 13:13:08.613879+00 |
description | Generate JSON Schema from Facet types. Provides a `to_string` function to get a JSON Schema representation as a string. Useful for reflection, introspection, serialization, and deserialization. |
homepage | |
repository | https://github.com/facet-rs/facet-jsonschema |
max_upload_size | |
id | 1649128 |
size | 35,576 |
Logo by Misiasart
Thanks to all individual and corporate sponsors, without whom this work could not exist:
This module provides functionality to generate JSON Schema from Facet types.
The main function is to_string
, which takes a Facet type and returns its JSON Schema representation as a string.
use facet_jsonschema::to_string;
use facet::Facet;
#[derive(Facet)]
struct TestStruct {
/// String field
string_field: String,
/// Integer field
int_field: u32,
}
let schema = to_string::<TestStruct>();
println!("JSON Schema: {schema}");
Licensed under either of:
at your option.