Add separate docs for v0.8/v1
This commit is contained in:
parent
3150f98fc8
commit
d511d447f7
61 changed files with 1620 additions and 58 deletions
15
docs/_includes/examples_v0/enum_repr.rs
Normal file
15
docs/_includes/examples_v0/enum_repr.rs
Normal file
|
@ -0,0 +1,15 @@
|
|||
use schemars::{schema_for, JsonSchema_repr};
|
||||
|
||||
#[derive(JsonSchema_repr)]
|
||||
#[repr(u8)]
|
||||
enum SmallPrime {
|
||||
Two = 2,
|
||||
Three = 3,
|
||||
Five = 5,
|
||||
Seven = 7,
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let schema = schema_for!(SmallPrime);
|
||||
println!("{}", serde_json::to_string_pretty(&schema).unwrap());
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue