Implement JsonSchema for chrono types
Requires chrono feature.
This commit is contained in:
parent
7285dde99a
commit
a236d7aee0
9 changed files with 178 additions and 28 deletions
42
schemars/tests/expected/chrono-types.json
Normal file
42
schemars/tests/expected/chrono-types.json
Normal file
|
@ -0,0 +1,42 @@
|
|||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"title": "ChronoTypes",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"date_time": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"naive_date": {
|
||||
"type": "string",
|
||||
"format": "date"
|
||||
},
|
||||
"naive_date_time": {
|
||||
"type": "string",
|
||||
"format": "partial-date-time"
|
||||
},
|
||||
"naive_time": {
|
||||
"type": "string",
|
||||
"format": "partial-date-time"
|
||||
},
|
||||
"weekday": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"Mon",
|
||||
"Tue",
|
||||
"Wed",
|
||||
"Thu",
|
||||
"Fri",
|
||||
"Sat",
|
||||
"Sun"
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"date_time",
|
||||
"naive_date",
|
||||
"naive_date_time",
|
||||
"naive_time",
|
||||
"weekday"
|
||||
]
|
||||
}
|
|
@ -88,6 +88,10 @@
|
|||
"items": {},
|
||||
"nullable": true
|
||||
},
|
||||
"format": {
|
||||
"type": "string",
|
||||
"nullable": true
|
||||
},
|
||||
"items": {
|
||||
"anyOf": [
|
||||
{
|
||||
|
|
|
@ -24,6 +24,17 @@
|
|||
"integer"
|
||||
]
|
||||
},
|
||||
"Ref": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"$ref": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"$ref"
|
||||
]
|
||||
},
|
||||
"Schema": {
|
||||
"anyOf": [
|
||||
{
|
||||
|
@ -113,6 +124,16 @@
|
|||
}
|
||||
]
|
||||
},
|
||||
"format": {
|
||||
"anyOf": [
|
||||
{
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
]
|
||||
},
|
||||
"items": {
|
||||
"anyOf": [
|
||||
{
|
||||
|
@ -181,17 +202,6 @@
|
|||
},
|
||||
"additionalProperties": true
|
||||
},
|
||||
"Ref": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"$ref": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"$ref"
|
||||
]
|
||||
},
|
||||
"SingleOrVec_For_InstanceType": {
|
||||
"anyOf": [
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue