Update OpenAPI 3.0 schema URI
This commit is contained in:
parent
dec3c67e87
commit
4dde683358
3 changed files with 73 additions and 73 deletions
|
@ -88,7 +88,7 @@ impl SchemaSettings {
|
||||||
option_add_null_type: false,
|
option_add_null_type: false,
|
||||||
definitions_path: "#/components/schemas/".to_owned(),
|
definitions_path: "#/components/schemas/".to_owned(),
|
||||||
meta_schema: Some(
|
meta_schema: Some(
|
||||||
"https://spec.openapis.org/oas/3.0/schema/2019-04-02#/definitions/Schema"
|
"https://spec.openapis.org/oas/3.0/schema/2021-09-28#/definitions/Schema"
|
||||||
.to_owned(),
|
.to_owned(),
|
||||||
),
|
),
|
||||||
visitors: vec![
|
visitors: vec![
|
||||||
|
|
|
@ -1,58 +1,7 @@
|
||||||
{
|
{
|
||||||
"$schema": "https://spec.openapis.org/oas/3.0/schema/2019-04-02#/definitions/Schema",
|
"$schema": "https://spec.openapis.org/oas/3.0/schema/2021-09-28#/definitions/Schema",
|
||||||
"title": "MyStruct",
|
"title": "MyStruct",
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
|
||||||
"myInt": {
|
|
||||||
"type": "integer"
|
|
||||||
},
|
|
||||||
"myBool": {
|
|
||||||
"type": "boolean"
|
|
||||||
},
|
|
||||||
"myNullableEnum": {
|
|
||||||
"nullable": true
|
|
||||||
},
|
|
||||||
"myInnerStruct": {
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"my_map": {
|
|
||||||
"type": "object",
|
|
||||||
"additionalProperties": {
|
|
||||||
"type": "number"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"my_vec": {
|
|
||||||
"type": "array",
|
|
||||||
"items": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"my_empty_map": {
|
|
||||||
"type": "object",
|
|
||||||
"additionalProperties": true
|
|
||||||
},
|
|
||||||
"my_empty_vec": {
|
|
||||||
"type": "array",
|
|
||||||
"items": {}
|
|
||||||
},
|
|
||||||
"my_tuple": {
|
|
||||||
"type": "array",
|
|
||||||
"items": [
|
|
||||||
{
|
|
||||||
"type": "string",
|
|
||||||
"maxLength": 1,
|
|
||||||
"minLength": 1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "integer"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"maxItems": 2,
|
|
||||||
"minItems": 2
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"example": {
|
"example": {
|
||||||
"myBool": true,
|
"myBool": true,
|
||||||
"myInnerStruct": {
|
"myInnerStruct": {
|
||||||
|
@ -72,5 +21,56 @@
|
||||||
},
|
},
|
||||||
"myInt": 123,
|
"myInt": 123,
|
||||||
"myNullableEnum": null
|
"myNullableEnum": null
|
||||||
|
},
|
||||||
|
"properties": {
|
||||||
|
"myBool": {
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
"myInnerStruct": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"my_empty_map": {
|
||||||
|
"type": "object",
|
||||||
|
"additionalProperties": true
|
||||||
|
},
|
||||||
|
"my_empty_vec": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {}
|
||||||
|
},
|
||||||
|
"my_map": {
|
||||||
|
"type": "object",
|
||||||
|
"additionalProperties": {
|
||||||
|
"type": "number"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"my_tuple": {
|
||||||
|
"type": "array",
|
||||||
|
"items": [
|
||||||
|
{
|
||||||
|
"type": "string",
|
||||||
|
"maxLength": 1,
|
||||||
|
"minLength": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "integer"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"maxItems": 2,
|
||||||
|
"minItems": 2
|
||||||
|
},
|
||||||
|
"my_vec": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"myInt": {
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"myNullableEnum": {
|
||||||
|
"nullable": true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,23 +1,8 @@
|
||||||
{
|
{
|
||||||
"$schema": "https://spec.openapis.org/oas/3.0/schema/2019-04-02#/definitions/Schema",
|
"$schema": "https://spec.openapis.org/oas/3.0/schema/2021-09-28#/definitions/Schema",
|
||||||
"title": "Outer",
|
"title": "Outer",
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"required": [
|
|
||||||
"int",
|
|
||||||
"value",
|
|
||||||
"values"
|
|
||||||
],
|
|
||||||
"properties": {
|
"properties": {
|
||||||
"int": {
|
|
||||||
"type": "integer",
|
|
||||||
"format": "int32",
|
|
||||||
"example": 8
|
|
||||||
},
|
|
||||||
"values": {
|
|
||||||
"type": "object",
|
|
||||||
"additionalProperties": true
|
|
||||||
},
|
|
||||||
"value": {},
|
|
||||||
"inner": {
|
"inner": {
|
||||||
"allOf": [
|
"allOf": [
|
||||||
{
|
{
|
||||||
|
@ -25,8 +10,23 @@
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"nullable": true
|
"nullable": true
|
||||||
|
},
|
||||||
|
"int": {
|
||||||
|
"type": "integer",
|
||||||
|
"format": "int32",
|
||||||
|
"example": 8
|
||||||
|
},
|
||||||
|
"value": {},
|
||||||
|
"values": {
|
||||||
|
"type": "object",
|
||||||
|
"additionalProperties": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"required": [
|
||||||
|
"int",
|
||||||
|
"value",
|
||||||
|
"values"
|
||||||
|
],
|
||||||
"definitions": {
|
"definitions": {
|
||||||
"Inner": {
|
"Inner": {
|
||||||
"oneOf": [
|
"oneOf": [
|
||||||
|
@ -46,13 +46,13 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"required": [
|
"additionalProperties": false,
|
||||||
"ValueNewType"
|
|
||||||
],
|
|
||||||
"properties": {
|
"properties": {
|
||||||
"ValueNewType": {}
|
"ValueNewType": {}
|
||||||
},
|
},
|
||||||
"additionalProperties": false
|
"required": [
|
||||||
|
"ValueNewType"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue