Support JSON Schema draft 2020-12 and use it by default (#294)
This commit is contained in:
parent
95475ad1b4
commit
3aa0e7fa3c
88 changed files with 369 additions and 210 deletions
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"title": "Array_up_to_size_16_of_int32",
|
||||
"type": "array",
|
||||
"items": {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"title": "string",
|
||||
"type": "string"
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"title": "Decimal",
|
||||
"type": "string",
|
||||
"pattern": "^-?[0-9]+(\\.[0-9]+)?$"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"title": "MyContainer",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"title": "Tuple_of_Array_of_uint8_and_Array_of_uint8",
|
||||
"type": "array",
|
||||
"items": [
|
||||
"prefixItems": [
|
||||
{
|
||||
"type": "array",
|
||||
"items": {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"title": "ChronoTypes",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"title": "Struct",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"title": "MyStruct",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
@ -13,21 +13,17 @@
|
|||
"default": false
|
||||
},
|
||||
"my_struct2": {
|
||||
"default": "i:0 b:false",
|
||||
"allOf": [
|
||||
{
|
||||
"$ref": "#/definitions/MyStruct2"
|
||||
}
|
||||
]
|
||||
"$ref": "#/$defs/MyStruct2",
|
||||
"default": "i:0 b:false"
|
||||
},
|
||||
"my_struct2_default_skipped": {
|
||||
"$ref": "#/definitions/MyStruct2"
|
||||
"$ref": "#/$defs/MyStruct2"
|
||||
},
|
||||
"not_serialize": {
|
||||
"$ref": "#/definitions/NotSerialize"
|
||||
"$ref": "#/$defs/NotSerialize"
|
||||
}
|
||||
},
|
||||
"definitions": {
|
||||
"$defs": {
|
||||
"MyStruct2": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"title": "DeprecatedEnum",
|
||||
"oneOf": [
|
||||
{
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"title": "DeprecatedStruct",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"title": "This is the enum's title",
|
||||
"description": "This is the enum's description.",
|
||||
"oneOf": [
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"title": "OverrideDocs struct",
|
||||
"description": "New description",
|
||||
"type": "object",
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"title": "This is the struct's title",
|
||||
"description": "This is the struct's description.",
|
||||
"type": "object",
|
||||
|
@ -14,11 +14,7 @@
|
|||
},
|
||||
"my_unit": {
|
||||
"description": "A unit struct instance",
|
||||
"allOf": [
|
||||
{
|
||||
"$ref": "#/definitions/MyUnitStruct"
|
||||
}
|
||||
]
|
||||
"$ref": "#/$defs/MyUnitStruct"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
|
@ -26,7 +22,7 @@
|
|||
"my_undocumented_bool",
|
||||
"my_unit"
|
||||
],
|
||||
"definitions": {
|
||||
"$defs": {
|
||||
"MyUnitStruct": {
|
||||
"title": "A Unit",
|
||||
"type": "null"
|
||||
|
|
|
@ -1,20 +1,20 @@
|
|||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"title": "MyStruct",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"duration": {
|
||||
"$ref": "#/definitions/Duration"
|
||||
"$ref": "#/$defs/Duration"
|
||||
},
|
||||
"time": {
|
||||
"$ref": "#/definitions/SystemTime"
|
||||
"$ref": "#/$defs/SystemTime"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"duration",
|
||||
"time"
|
||||
],
|
||||
"definitions": {
|
||||
"$defs": {
|
||||
"Duration": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"title": "Either_int32_or_Either_boolean_or_null",
|
||||
"anyOf": [
|
||||
{
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"title": "Adjacent",
|
||||
"oneOf": [
|
||||
{
|
||||
|
@ -49,7 +49,7 @@
|
|||
]
|
||||
},
|
||||
"c": {
|
||||
"$ref": "#/definitions/UnitStruct"
|
||||
"$ref": "#/$defs/UnitStruct"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
|
@ -68,7 +68,7 @@
|
|||
]
|
||||
},
|
||||
"c": {
|
||||
"$ref": "#/definitions/Struct"
|
||||
"$ref": "#/$defs/Struct"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
|
@ -121,7 +121,7 @@
|
|||
},
|
||||
"c": {
|
||||
"type": "array",
|
||||
"items": [
|
||||
"prefixItems": [
|
||||
{
|
||||
"type": "integer",
|
||||
"format": "int32"
|
||||
|
@ -176,7 +176,7 @@
|
|||
"additionalProperties": false
|
||||
}
|
||||
],
|
||||
"definitions": {
|
||||
"$defs": {
|
||||
"UnitStruct": {
|
||||
"type": "null"
|
||||
},
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"title": "Adjacent",
|
||||
"oneOf": [
|
||||
{
|
||||
|
@ -47,7 +47,7 @@
|
|||
]
|
||||
},
|
||||
"c": {
|
||||
"$ref": "#/definitions/UnitStruct"
|
||||
"$ref": "#/$defs/UnitStruct"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
|
@ -65,7 +65,7 @@
|
|||
]
|
||||
},
|
||||
"c": {
|
||||
"$ref": "#/definitions/Struct"
|
||||
"$ref": "#/$defs/Struct"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
|
@ -115,7 +115,7 @@
|
|||
},
|
||||
"c": {
|
||||
"type": "array",
|
||||
"items": [
|
||||
"prefixItems": [
|
||||
{
|
||||
"type": "integer",
|
||||
"format": "int32"
|
||||
|
@ -167,7 +167,7 @@
|
|||
]
|
||||
}
|
||||
],
|
||||
"definitions": {
|
||||
"$defs": {
|
||||
"UnitStruct": {
|
||||
"type": "null"
|
||||
},
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"title": "External",
|
||||
"oneOf": [
|
||||
{
|
||||
|
@ -28,7 +28,7 @@
|
|||
"type": "object",
|
||||
"properties": {
|
||||
"unitStructNewType": {
|
||||
"$ref": "#/definitions/UnitStruct"
|
||||
"$ref": "#/$defs/UnitStruct"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
|
@ -40,7 +40,7 @@
|
|||
"type": "object",
|
||||
"properties": {
|
||||
"structNewType": {
|
||||
"$ref": "#/definitions/Struct"
|
||||
"$ref": "#/$defs/Struct"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
|
@ -79,7 +79,7 @@
|
|||
"properties": {
|
||||
"tuple": {
|
||||
"type": "array",
|
||||
"items": [
|
||||
"prefixItems": [
|
||||
{
|
||||
"type": "integer",
|
||||
"format": "int32"
|
||||
|
@ -111,7 +111,7 @@
|
|||
"additionalProperties": false
|
||||
}
|
||||
],
|
||||
"definitions": {
|
||||
"$defs": {
|
||||
"UnitStruct": {
|
||||
"type": "null"
|
||||
},
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"title": "External",
|
||||
"oneOf": [
|
||||
{
|
||||
|
@ -28,7 +28,7 @@
|
|||
"type": "object",
|
||||
"properties": {
|
||||
"unitStructNewType": {
|
||||
"$ref": "#/definitions/UnitStruct"
|
||||
"$ref": "#/$defs/UnitStruct"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
|
@ -40,7 +40,7 @@
|
|||
"type": "object",
|
||||
"properties": {
|
||||
"structNewType": {
|
||||
"$ref": "#/definitions/Struct"
|
||||
"$ref": "#/$defs/Struct"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
|
@ -78,7 +78,7 @@
|
|||
"properties": {
|
||||
"tuple": {
|
||||
"type": "array",
|
||||
"items": [
|
||||
"prefixItems": [
|
||||
{
|
||||
"type": "integer",
|
||||
"format": "int32"
|
||||
|
@ -110,7 +110,7 @@
|
|||
"additionalProperties": false
|
||||
}
|
||||
],
|
||||
"definitions": {
|
||||
"$defs": {
|
||||
"UnitStruct": {
|
||||
"type": "null"
|
||||
},
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"title": "Internal",
|
||||
"oneOf": [
|
||||
{
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"title": "Internal",
|
||||
"oneOf": [
|
||||
{
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"title": "Renamed",
|
||||
"description": "Description from comment",
|
||||
"type": "integer",
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"title": "Enum",
|
||||
"type": "integer",
|
||||
"enum": [
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"title": "SimpleInternal",
|
||||
"oneOf": [
|
||||
{
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"title": "SimpleInternal",
|
||||
"oneOf": [
|
||||
{
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"title": "SoundOfMusic",
|
||||
"oneOf": [
|
||||
{
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"title": "Untagged",
|
||||
"anyOf": [
|
||||
{
|
||||
|
@ -12,10 +12,10 @@
|
|||
}
|
||||
},
|
||||
{
|
||||
"$ref": "#/definitions/UnitStruct"
|
||||
"$ref": "#/$defs/UnitStruct"
|
||||
},
|
||||
{
|
||||
"$ref": "#/definitions/Struct"
|
||||
"$ref": "#/$defs/Struct"
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
|
@ -36,7 +36,7 @@
|
|||
},
|
||||
{
|
||||
"type": "array",
|
||||
"items": [
|
||||
"prefixItems": [
|
||||
{
|
||||
"type": "integer",
|
||||
"format": "int32"
|
||||
|
@ -53,7 +53,7 @@
|
|||
"format": "int32"
|
||||
}
|
||||
],
|
||||
"definitions": {
|
||||
"$defs": {
|
||||
"UnitStruct": {
|
||||
"type": "null"
|
||||
},
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"title": "Untagged",
|
||||
"anyOf": [
|
||||
{
|
||||
|
@ -12,10 +12,10 @@
|
|||
}
|
||||
},
|
||||
{
|
||||
"$ref": "#/definitions/UnitStruct"
|
||||
"$ref": "#/$defs/UnitStruct"
|
||||
},
|
||||
{
|
||||
"$ref": "#/definitions/Struct"
|
||||
"$ref": "#/$defs/Struct"
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
|
@ -35,7 +35,7 @@
|
|||
},
|
||||
{
|
||||
"type": "array",
|
||||
"items": [
|
||||
"prefixItems": [
|
||||
{
|
||||
"type": "integer",
|
||||
"format": "int32"
|
||||
|
@ -52,7 +52,7 @@
|
|||
"format": "int32"
|
||||
}
|
||||
],
|
||||
"definitions": {
|
||||
"$defs": {
|
||||
"UnitStruct": {
|
||||
"type": "null"
|
||||
},
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"title": "Set_of_Foo",
|
||||
"type": "array",
|
||||
"uniqueItems": true,
|
||||
"items": {
|
||||
"$ref": "#/definitions/Foo"
|
||||
"$ref": "#/$defs/Foo"
|
||||
},
|
||||
"definitions": {
|
||||
"$defs": {
|
||||
"Foo": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"title": "Struct",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"title": "Flat",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"zero": {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"title": "IndexMapTypes",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"title": "RecursiveOuter",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"direct": {
|
||||
"anyOf": [
|
||||
{
|
||||
"$ref": "#/definitions/RecursiveOuter"
|
||||
"$ref": "#/$defs/RecursiveOuter"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
|
@ -20,7 +20,7 @@
|
|||
],
|
||||
"properties": {
|
||||
"recursive": {
|
||||
"$ref": "#/definitions/RecursiveOuter"
|
||||
"$ref": "#/$defs/RecursiveOuter"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
|
@ -28,14 +28,14 @@
|
|||
]
|
||||
}
|
||||
},
|
||||
"definitions": {
|
||||
"$defs": {
|
||||
"RecursiveOuter": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"direct": {
|
||||
"anyOf": [
|
||||
{
|
||||
"$ref": "#/definitions/RecursiveOuter"
|
||||
"$ref": "#/$defs/RecursiveOuter"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
|
@ -49,7 +49,7 @@
|
|||
],
|
||||
"properties": {
|
||||
"recursive": {
|
||||
"$ref": "#/definitions/RecursiveOuter"
|
||||
"$ref": "#/$defs/RecursiveOuter"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"title": "MyJob",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"title": "OuterEnum",
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"InnerStruct": {
|
||||
"$ref": "#/definitions/InnerStruct"
|
||||
"$ref": "#/$defs/InnerStruct"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
|
@ -15,7 +15,7 @@
|
|||
"additionalProperties": false
|
||||
}
|
||||
],
|
||||
"definitions": {
|
||||
"$defs": {
|
||||
"InnerStruct": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"title": "A",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"title": "NoVariants",
|
||||
"type": "string",
|
||||
"enum": []
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"title": "MyStruct",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
|
|
@ -1,20 +1,20 @@
|
|||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"title": "OsStrings",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"owned": {
|
||||
"$ref": "#/definitions/OsString"
|
||||
"$ref": "#/$defs/OsString"
|
||||
},
|
||||
"borrowed": {
|
||||
"$ref": "#/definitions/OsString"
|
||||
"$ref": "#/$defs/OsString"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"owned",
|
||||
"borrowed"
|
||||
],
|
||||
"definitions": {
|
||||
"$defs": {
|
||||
"OsString": {
|
||||
"oneOf": [
|
||||
{
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"title": "MyStruct",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"title": "MyStruct",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"range": {
|
||||
"$ref": "#/definitions/Range_of_uint"
|
||||
"$ref": "#/$defs/Range_of_uint"
|
||||
},
|
||||
"inclusive": {
|
||||
"$ref": "#/definitions/Range_of_double"
|
||||
"$ref": "#/$defs/Range_of_double"
|
||||
},
|
||||
"bound": {
|
||||
"$ref": "#/definitions/Bound_of_string"
|
||||
"$ref": "#/$defs/Bound_of_string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
|
@ -18,7 +18,7 @@
|
|||
"inclusive",
|
||||
"bound"
|
||||
],
|
||||
"definitions": {
|
||||
"$defs": {
|
||||
"Range_of_uint": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"title": "Process",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
@ -7,33 +7,25 @@
|
|||
"type": "string"
|
||||
},
|
||||
"wall_time": {
|
||||
"$ref": "#/definitions/Duration"
|
||||
"$ref": "#/$defs/Duration"
|
||||
},
|
||||
"user_cpu_time": {
|
||||
"$ref": "#/$defs/Duration",
|
||||
"default": {
|
||||
"secs": 0,
|
||||
"nanos": 0
|
||||
},
|
||||
"allOf": [
|
||||
{
|
||||
"$ref": "#/definitions/Duration"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"system_cpu_time": {
|
||||
"default": "0.000000000s",
|
||||
"allOf": [
|
||||
{
|
||||
"$ref": "#/definitions/Duration"
|
||||
}
|
||||
]
|
||||
"$ref": "#/$defs/Duration",
|
||||
"default": "0.000000000s"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"command_line",
|
||||
"wall_time"
|
||||
],
|
||||
"definitions": {
|
||||
"$defs": {
|
||||
"Duration": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"title": "MyStruct_for_int32",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"byte_or_bool2": {
|
||||
"$ref": "#/definitions/Or_for_uint8_and_boolean"
|
||||
"$ref": "#/$defs/Or_for_uint8_and_boolean"
|
||||
},
|
||||
"unit_or_t2": {
|
||||
"$ref": "#/definitions/Or_for_null_and_int32"
|
||||
"$ref": "#/$defs/Or_for_null_and_int32"
|
||||
},
|
||||
"s": {
|
||||
"$ref": "#/definitions/Str"
|
||||
"$ref": "#/$defs/Str"
|
||||
},
|
||||
"fake_map": {
|
||||
"type": "object",
|
||||
|
@ -29,7 +29,7 @@
|
|||
"s",
|
||||
"fake_map"
|
||||
],
|
||||
"definitions": {
|
||||
"$defs": {
|
||||
"Or_for_uint8_and_boolean": {
|
||||
"anyOf": [
|
||||
{
|
||||
|
|
|
@ -1,27 +1,27 @@
|
|||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"title": "Container",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"result1": {
|
||||
"$ref": "#/definitions/Result_of_MyStruct_or_Array_of_string"
|
||||
"$ref": "#/$defs/Result_of_MyStruct_or_Array_of_string"
|
||||
},
|
||||
"result2": {
|
||||
"$ref": "#/definitions/Result_of_boolean_or_null"
|
||||
"$ref": "#/$defs/Result_of_boolean_or_null"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"result1",
|
||||
"result2"
|
||||
],
|
||||
"definitions": {
|
||||
"$defs": {
|
||||
"Result_of_MyStruct_or_Array_of_string": {
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"Ok": {
|
||||
"$ref": "#/definitions/MyStruct"
|
||||
"$ref": "#/$defs/MyStruct"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"title": "Decimal",
|
||||
"type": "string",
|
||||
"pattern": "^-?[0-9]+(\\.[0-9]+)?$"
|
||||
|
|
|
@ -1,20 +1,20 @@
|
|||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"title": "Config2",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"a_cfg": {
|
||||
"$ref": "#/definitions/Config"
|
||||
"$ref": "#/$defs/Config"
|
||||
},
|
||||
"b_cfg": {
|
||||
"$ref": "#/definitions/Config2"
|
||||
"$ref": "#/$defs/Config2"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"a_cfg",
|
||||
"b_cfg"
|
||||
],
|
||||
"definitions": {
|
||||
"$defs": {
|
||||
"Config": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"title": "const-generics-z-42",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"title": "a-new-name-Array_of_string-int32-int32",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
@ -20,7 +20,7 @@
|
|||
}
|
||||
},
|
||||
"inner": {
|
||||
"$ref": "#/definitions/another-new-name"
|
||||
"$ref": "#/$defs/another-new-name"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
|
@ -30,7 +30,7 @@
|
|||
"w",
|
||||
"inner"
|
||||
],
|
||||
"definitions": {
|
||||
"$defs": {
|
||||
"another-new-name": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"title": "MyStruct_for_int32_and_null_and_boolean_and_Array_of_string",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
@ -20,7 +20,7 @@
|
|||
}
|
||||
},
|
||||
"inner": {
|
||||
"$ref": "#/definitions/MySimpleStruct"
|
||||
"$ref": "#/$defs/MySimpleStruct"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
|
@ -30,7 +30,7 @@
|
|||
"w",
|
||||
"inner"
|
||||
],
|
||||
"definitions": {
|
||||
"$defs": {
|
||||
"MySimpleStruct": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"title": "MixedGenericStruct_for_MyStruct_for_int32_and_null_and_boolean_and_Array_of_string_and_42_and_z",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"generic": {
|
||||
"$ref": "#/definitions/MyStruct_for_int32_and_null_and_boolean_and_Array_of_string"
|
||||
"$ref": "#/$defs/MyStruct_for_int32_and_null_and_boolean_and_Array_of_string"
|
||||
},
|
||||
"foo": {
|
||||
"type": "integer",
|
||||
|
@ -15,7 +15,7 @@
|
|||
"generic",
|
||||
"foo"
|
||||
],
|
||||
"definitions": {
|
||||
"$defs": {
|
||||
"MyStruct_for_int32_and_null_and_boolean_and_Array_of_string": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
@ -36,7 +36,7 @@
|
|||
}
|
||||
},
|
||||
"inner": {
|
||||
"$ref": "#/definitions/MySimpleStruct"
|
||||
"$ref": "#/$defs/MySimpleStruct"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
|
|
|
@ -25,12 +25,32 @@
|
|||
"type": "null"
|
||||
}
|
||||
]
|
||||
},
|
||||
"tuples": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "array",
|
||||
"items": [
|
||||
{
|
||||
"type": "integer",
|
||||
"format": "uint8",
|
||||
"minimum": 0
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"format": "int64"
|
||||
}
|
||||
],
|
||||
"minItems": 2,
|
||||
"maxItems": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"int",
|
||||
"values",
|
||||
"value"
|
||||
"value",
|
||||
"tuples"
|
||||
],
|
||||
"$defs": {
|
||||
"Inner": {
|
||||
|
|
83
schemars/tests/expected/schema_settings-2020_12.json
Normal file
83
schemars/tests/expected/schema_settings-2020_12.json
Normal file
|
@ -0,0 +1,83 @@
|
|||
{
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"title": "Outer",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"int": {
|
||||
"type": "integer",
|
||||
"format": "int32",
|
||||
"examples": [
|
||||
8,
|
||||
null
|
||||
]
|
||||
},
|
||||
"values": {
|
||||
"type": "object",
|
||||
"additionalProperties": true
|
||||
},
|
||||
"value": true,
|
||||
"inner": {
|
||||
"anyOf": [
|
||||
{
|
||||
"$ref": "#/$defs/Inner"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
]
|
||||
},
|
||||
"tuples": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "array",
|
||||
"prefixItems": [
|
||||
{
|
||||
"type": "integer",
|
||||
"format": "uint8",
|
||||
"minimum": 0
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"format": "int64"
|
||||
}
|
||||
],
|
||||
"minItems": 2,
|
||||
"maxItems": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"int",
|
||||
"values",
|
||||
"value",
|
||||
"tuples"
|
||||
],
|
||||
"$defs": {
|
||||
"Inner": {
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"UndocumentedUnit1",
|
||||
"UndocumentedUnit2"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "This is a documented unit variant",
|
||||
"type": "string",
|
||||
"const": "DocumentedUnit"
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"ValueNewType": true
|
||||
},
|
||||
"required": [
|
||||
"ValueNewType"
|
||||
],
|
||||
"additionalProperties": false
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
|
@ -20,12 +20,32 @@
|
|||
"$ref": "#/components/schemas/Inner"
|
||||
}
|
||||
]
|
||||
},
|
||||
"tuples": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "array",
|
||||
"items": [
|
||||
{
|
||||
"type": "integer",
|
||||
"format": "uint8",
|
||||
"minimum": 0
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"format": "int64"
|
||||
}
|
||||
],
|
||||
"minItems": 2,
|
||||
"maxItems": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"int",
|
||||
"values",
|
||||
"value"
|
||||
"value",
|
||||
"tuples"
|
||||
],
|
||||
"components": {
|
||||
"schemas": {
|
||||
|
|
|
@ -25,12 +25,32 @@
|
|||
"type": "null"
|
||||
}
|
||||
]
|
||||
},
|
||||
"tuples": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "array",
|
||||
"items": [
|
||||
{
|
||||
"type": "integer",
|
||||
"format": "uint8",
|
||||
"minimum": 0
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"format": "int64"
|
||||
}
|
||||
],
|
||||
"minItems": 2,
|
||||
"maxItems": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"int",
|
||||
"values",
|
||||
"value"
|
||||
"value",
|
||||
"tuples"
|
||||
],
|
||||
"definitions": {
|
||||
"Inner": {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"title": "Adjacent",
|
||||
"oneOf": [
|
||||
{
|
||||
|
@ -57,7 +57,7 @@
|
|||
},
|
||||
"c": {
|
||||
"type": "array",
|
||||
"items": [
|
||||
"prefixItems": [
|
||||
{
|
||||
"type": "boolean"
|
||||
},
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"title": "External",
|
||||
"oneOf": [
|
||||
{
|
||||
|
@ -39,7 +39,7 @@
|
|||
"properties": {
|
||||
"tuple": {
|
||||
"type": "array",
|
||||
"items": [
|
||||
"prefixItems": [
|
||||
{
|
||||
"type": "boolean"
|
||||
},
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"title": "Internal",
|
||||
"oneOf": [
|
||||
{
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"title": "Untagged",
|
||||
"anyOf": [
|
||||
{
|
||||
|
@ -18,7 +18,7 @@
|
|||
},
|
||||
{
|
||||
"type": "array",
|
||||
"items": [
|
||||
"prefixItems": [
|
||||
{
|
||||
"type": "boolean"
|
||||
},
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"title": "Newtype",
|
||||
"type": "boolean"
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"title": "Struct",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"title": "schema_fn",
|
||||
"type": "boolean"
|
||||
}
|
|
@ -1,8 +1,8 @@
|
|||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"title": "Tuple",
|
||||
"type": "array",
|
||||
"items": [
|
||||
"prefixItems": [
|
||||
{
|
||||
"type": "boolean"
|
||||
},
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"title": "SemverTypes",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"title": "MyEnum",
|
||||
"oneOf": [
|
||||
{
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"title": "MyStruct",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"title": "TupleStruct",
|
||||
"type": "array",
|
||||
"items": [
|
||||
"prefixItems": [
|
||||
{
|
||||
"type": "number",
|
||||
"format": "float"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"title": "Array_of_string",
|
||||
"type": "array",
|
||||
"items": {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"title": "string",
|
||||
"type": "string"
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"title": "Newtype",
|
||||
"type": "integer",
|
||||
"format": "int32"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"title": "Struct",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"title": "Struct",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"title": "Tuple",
|
||||
"type": "array",
|
||||
"items": [
|
||||
"prefixItems": [
|
||||
{
|
||||
"type": "integer",
|
||||
"format": "int32"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"title": "Unit",
|
||||
"type": "null"
|
||||
}
|
|
@ -1,12 +1,12 @@
|
|||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"title": "OuterStruct",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"inner": {
|
||||
"anyOf": [
|
||||
{
|
||||
"$ref": "#/definitions/InnerStruct"
|
||||
"$ref": "#/$defs/InnerStruct"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
|
@ -14,10 +14,10 @@
|
|||
]
|
||||
}
|
||||
},
|
||||
"definitions": {
|
||||
"$defs": {
|
||||
"InnerStruct": {
|
||||
"type": "array",
|
||||
"items": [
|
||||
"prefixItems": [
|
||||
{
|
||||
"type": "string"
|
||||
},
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"title": "UrlTypes",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"title": "Uuid",
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"title": "Struct",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"title": "Struct",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"title": "NewType",
|
||||
"type": "integer",
|
||||
"format": "uint8",
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"title": "Struct2",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"title": "Tuple",
|
||||
"type": "array",
|
||||
"items": [
|
||||
"prefixItems": [
|
||||
{
|
||||
"type": "integer",
|
||||
"format": "uint8",
|
||||
|
|
|
@ -12,6 +12,7 @@ pub struct Outer {
|
|||
pub values: BTreeMap<&'static str, Value>,
|
||||
pub value: Value,
|
||||
pub inner: Option<Inner>,
|
||||
pub tuples: Vec<(u8, i64)>,
|
||||
}
|
||||
|
||||
#[derive(JsonSchema)]
|
||||
|
@ -39,6 +40,11 @@ fn schema_matches_2019_09() -> TestResult {
|
|||
test_generated_schema::<Outer>("schema_settings-2019_09", SchemaSettings::draft2019_09())
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn schema_matches_2020_12() -> TestResult {
|
||||
test_generated_schema::<Outer>("schema_settings-2020_12", SchemaSettings::draft2020_12())
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn schema_matches_openapi3() -> TestResult {
|
||||
test_generated_schema::<Outer>("schema_settings-openapi3", SchemaSettings::openapi3())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue