Crates.io | facet-jsonschema |
lib.rs | facet-jsonschema |
version | |
source | src |
created_at | 2025-04-25 15:28:26.333167+00 |
updated_at | 2025-05-10 20:40:04.177642+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 |
max_upload_size | |
id | 1649128 |
Cargo.toml error: | TOML parse error at line 18, column 1 | 18 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
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.