schemars/schemars/tests/result.rs
2019-10-27 22:30:01 +00:00

19 lines
335 B
Rust

mod util;
use schemars::JsonSchema;
use util::*;
#[derive(Debug, JsonSchema)]
struct MyStruct {
foo: i32,
}
#[derive(Debug, JsonSchema)]
struct Container {
result1: Result<MyStruct, Vec<String>>,
result2: Result<bool, ()>,
}
#[test]
fn result() -> TestResult {
test_default_generated_schema::<Container>("result")
}