Implement JsonSchema for Result<T,E>
This commit is contained in:
parent
3d68dbe929
commit
155190c9ab
4 changed files with 107 additions and 8 deletions
13
schemars/tests/result.rs
Normal file
13
schemars/tests/result.rs
Normal 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")
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue