5 releases (3 breaking)
Uses new Rust 2024
new 0.18.1 | Apr 26, 2025 |
---|---|
0.18.0 | Apr 26, 2025 |
0.17.0 | Apr 26, 2025 |
0.16.0 | Apr 25, 2025 |
0.15.0 | Apr 25, 2025 |
#1711 in Development tools
95 downloads per month
510KB
10K
SLoC
Logo by Misiasart
Thanks to all individual and corporate sponsors, without whom this work could not exist:
JSON Schema generation for Facet
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.
Example
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}");
License
Licensed under either of:
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Dependencies
~610KB
~11K SLoC