Implement JsonSchema for std::time types

This commit is contained in:
Graham Esau 2019-10-27 18:57:36 +00:00
parent 155190c9ab
commit e11d5e5a98
4 changed files with 95 additions and 0 deletions

View file

@ -0,0 +1,45 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "MyStruct",
"type": "object",
"required": [
"duration",
"time"
],
"properties": {
"duration": {
"$ref": "#/definitions/Duration"
},
"time": {
"$ref": "#/definitions/SystemTime"
}
},
"definitions": {
"Duration": {
"type": "object",
"properties": {
"nanos": {
"type": "integer",
"format": "uint32"
},
"secs": {
"type": "integer",
"format": "uint64"
}
}
},
"SystemTime": {
"type": "object",
"properties": {
"nanos_since_epoch": {
"type": "integer",
"format": "uint32"
},
"secs_since_epoch": {
"type": "integer",
"format": "uint64"
}
}
}
}
}