Improve schema naming for deriving on remote types

This commit is contained in:
Graham Esau 2019-12-27 15:37:59 +00:00
parent ea28450c30
commit 781f40b061
8 changed files with 36 additions and 23 deletions

View file

@ -16,6 +16,7 @@ use schemars::{schema_for, JsonSchema};
// This is just a copy of the remote data structure that Schemars can use to
// create a suitable JsonSchema impl.
#[derive(JsonSchema)]
#[serde(remote = "Duration")]
pub struct DurationDef {
pub secs: i64,
pub nanos: i32,

View file

@ -11,11 +11,11 @@
"type": "string"
},
"wall_time": {
"$ref": "#/definitions/DurationDef"
"$ref": "#/definitions/Duration"
}
},
"definitions": {
"DurationDef": {
"Duration": {
"type": "object",
"required": [
"nanos",