Implement JsonSchema for std::time types
This commit is contained in:
parent
155190c9ab
commit
e11d5e5a98
4 changed files with 95 additions and 0 deletions
45
schemars/tests/expected/duration_and_systemtime.json
Normal file
45
schemars/tests/expected/duration_and_systemtime.json
Normal 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"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue