mirror of
https://git.proxmox.com/git/rustc
synced 2025-08-26 07:31:37 +00:00
26 lines
478 B
Rust
26 lines
478 B
Rust
mod util;
|
|
use schemars::JsonSchema;
|
|
use serde::Serialize;
|
|
use util::*;
|
|
|
|
#[derive(Default, JsonSchema, Serialize)]
|
|
#[schemars(example = "Struct::default", example = "null")]
|
|
struct Struct {
|
|
#[schemars(example = "eight", example = "null")]
|
|
foo: i32,
|
|
bar: bool,
|
|
#[schemars(example = "null")]
|
|
baz: Option<&'static str>,
|
|
}
|
|
|
|
fn eight() -> i32 {
|
|
8
|
|
}
|
|
|
|
fn null() {}
|
|
|
|
#[test]
|
|
fn examples() -> TestResult {
|
|
test_default_generated_schema::<Struct>("examples")
|
|
}
|