Implement JsonSchema for Result<T,E>

This commit is contained in:
Graham Esau 2019-10-27 18:40:57 +00:00
parent 3d68dbe929
commit 155190c9ab
4 changed files with 107 additions and 8 deletions

13
schemars/tests/result.rs Normal file
View file

@ -0,0 +1,13 @@
mod util;
use schemars::JsonSchema;
use util::*;
#[derive(Debug, JsonSchema)]
struct MyStruct {
foo: i32,
}
#[test]
fn result() -> TestResult {
test_default_generated_schema::<Result<MyStruct, Vec<String>>>("result")
}