Updated embedded OAS schemas and fixed UniqueValues

UniqueValues was marked as an integer, not a boolean.

Signed-off-by: Dave Shanley <dave@quobix.com>
This commit is contained in:
Dave Shanley
2023-04-28 18:55:16 -04:00
parent 736fbfd0c3
commit 26e694a5e9
4 changed files with 1224 additions and 1152 deletions

View File

@@ -84,7 +84,7 @@ type Schema struct {
Format string `json:"format,omitempty" yaml:"format,omitempty"`
MaxItems *int64 `json:"maxItems,omitempty" yaml:"maxItems,omitempty"`
MinItems *int64 `json:"minItems,omitempty" yaml:"minItems,omitempty"`
UniqueItems *int64 `json:"uniqueItems,omitempty" yaml:"uniqueItems,omitempty"`
UniqueItems *bool `json:"uniqueItems,omitempty" yaml:"uniqueItems,omitempty"`
MaxProperties *int64 `json:"maxProperties,omitempty" yaml:"maxProperties,omitempty"`
MinProperties *int64 `json:"minProperties,omitempty" yaml:"minProperties,omitempty"`
Required []string `json:"required,omitempty" yaml:"required,omitempty"`
@@ -171,13 +171,15 @@ func NewSchema(schema *base.Schema) *Schema {
if !schema.MinContains.IsEmpty() {
s.MinContains = &schema.MinContains.Value
}
if !schema.UniqueItems.IsEmpty() {
s.UniqueItems = &schema.UniqueItems.Value
}
if !schema.Contains.IsEmpty() {
s.Contains = &SchemaProxy{schema: &lowmodel.NodeReference[*base.SchemaProxy]{
ValueNode: schema.Contains.ValueNode,
Value: schema.Contains.Value,
}}
}
if !schema.If.IsEmpty() {
s.If = &SchemaProxy{schema: &lowmodel.NodeReference[*base.SchemaProxy]{
ValueNode: schema.If.ValueNode,

File diff suppressed because it is too large Load Diff

View File

@@ -46,7 +46,8 @@
}
},
"patternProperties": {
"^x-": {}
"^x-": {
}
},
"additionalProperties": false,
"definitions": {
@@ -90,7 +91,8 @@
}
},
"patternProperties": {
"^x-": {}
"^x-": {
}
},
"additionalProperties": false
},
@@ -110,7 +112,8 @@
}
},
"patternProperties": {
"^x-": {}
"^x-": {
}
},
"additionalProperties": false
},
@@ -129,7 +132,8 @@
}
},
"patternProperties": {
"^x-": {}
"^x-": {
}
},
"additionalProperties": false
},
@@ -153,7 +157,8 @@
}
},
"patternProperties": {
"^x-": {}
"^x-": {
}
},
"additionalProperties": false
},
@@ -177,7 +182,8 @@
}
},
"patternProperties": {
"^x-": {}
"^x-": {
}
},
"additionalProperties": false
},
@@ -321,7 +327,8 @@
}
},
"patternProperties": {
"^x-": {}
"^x-": {
}
},
"additionalProperties": false
},
@@ -395,7 +402,8 @@
},
"enum": {
"type": "array",
"items": {},
"items": {
},
"minItems": 1,
"uniqueItems": false
},
@@ -502,7 +510,8 @@
"format": {
"type": "string"
},
"default": {},
"default": {
},
"nullable": {
"type": "boolean",
"default": false
@@ -518,7 +527,8 @@
"type": "boolean",
"default": false
},
"example": {},
"example": {
},
"externalDocs": {
"$ref": "#/definitions/ExternalDocumentation"
},
@@ -531,7 +541,8 @@
}
},
"patternProperties": {
"^x-": {}
"^x-": {
}
},
"additionalProperties": false
},
@@ -575,7 +586,8 @@
}
},
"patternProperties": {
"^x-": {}
"^x-": {
}
},
"additionalProperties": false
},
@@ -622,7 +634,8 @@
}
},
"patternProperties": {
"^x-": {}
"^x-": {
}
},
"additionalProperties": false
},
@@ -639,7 +652,8 @@
}
]
},
"example": {},
"example": {
},
"examples": {
"type": "object",
"additionalProperties": {
@@ -661,7 +675,8 @@
}
},
"patternProperties": {
"^x-": {}
"^x-": {
}
},
"additionalProperties": false,
"allOf": [
@@ -679,14 +694,16 @@
"description": {
"type": "string"
},
"value": {},
"value": {
},
"externalValue": {
"type": "string",
"format": "uri-reference"
}
},
"patternProperties": {
"^x-": {}
"^x-": {
}
},
"additionalProperties": false
},
@@ -740,7 +757,8 @@
"minProperties": 1,
"maxProperties": 1
},
"example": {},
"example": {
},
"examples": {
"type": "object",
"additionalProperties": {
@@ -756,7 +774,8 @@
}
},
"patternProperties": {
"^x-": {}
"^x-": {
}
},
"additionalProperties": false,
"allOf": [
@@ -774,7 +793,8 @@
"^\\/": {
"$ref": "#/definitions/PathItem"
},
"^x-": {}
"^x-": {
}
},
"additionalProperties": false
},
@@ -815,7 +835,8 @@
"^(get|put|post|delete|options|head|patch|trace)$": {
"$ref": "#/definitions/Operation"
},
"^x-": {}
"^x-": {
}
},
"additionalProperties": false
},
@@ -901,7 +922,8 @@
}
},
"patternProperties": {
"^x-": {}
"^x-": {
}
},
"additionalProperties": false
},
@@ -930,7 +952,8 @@
}
]
},
"^x-": {}
"^x-": {
}
},
"minProperties": 1,
"additionalProperties": false
@@ -961,7 +984,8 @@
}
},
"patternProperties": {
"^x-": {}
"^x-": {
}
},
"additionalProperties": false
},
@@ -980,7 +1004,8 @@
}
},
"patternProperties": {
"^x-": {}
"^x-": {
}
},
"additionalProperties": false
},
@@ -1104,7 +1129,8 @@
"minProperties": 1,
"maxProperties": 1
},
"example": {},
"example": {
},
"examples": {
"type": "object",
"additionalProperties": {
@@ -1120,7 +1146,8 @@
}
},
"patternProperties": {
"^x-": {}
"^x-": {
}
},
"additionalProperties": false,
"required": [
@@ -1242,7 +1269,8 @@
}
},
"patternProperties": {
"^x-": {}
"^x-": {
}
},
"additionalProperties": false
},
@@ -1292,7 +1320,8 @@
}
},
"patternProperties": {
"^x-": {}
"^x-": {
}
},
"additionalProperties": false
},
@@ -1320,7 +1349,8 @@
}
},
"patternProperties": {
"^x-": {}
"^x-": {
}
},
"additionalProperties": false,
"oneOf": [
@@ -1372,7 +1402,8 @@
}
},
"patternProperties": {
"^x-": {}
"^x-": {
}
},
"additionalProperties": false
},
@@ -1398,7 +1429,8 @@
}
},
"patternProperties": {
"^x-": {}
"^x-": {
}
},
"additionalProperties": false
},
@@ -1419,7 +1451,8 @@
}
},
"patternProperties": {
"^x-": {}
"^x-": {
}
},
"additionalProperties": false
},
@@ -1446,7 +1479,8 @@
}
},
"patternProperties": {
"^x-": {}
"^x-": {
}
},
"additionalProperties": false
},
@@ -1473,7 +1507,8 @@
}
},
"patternProperties": {
"^x-": {}
"^x-": {
}
},
"additionalProperties": false
},
@@ -1500,7 +1535,8 @@
}
},
"patternProperties": {
"^x-": {}
"^x-": {
}
},
"additionalProperties": false
},
@@ -1532,7 +1568,8 @@
}
},
"patternProperties": {
"^x-": {}
"^x-": {
}
},
"additionalProperties": false
},
@@ -1548,9 +1585,11 @@
},
"parameters": {
"type": "object",
"additionalProperties": {}
"additionalProperties": {
}
},
"requestBody": {
},
"requestBody": {},
"description": {
"type": "string"
},
@@ -1559,7 +1598,8 @@
}
},
"patternProperties": {
"^x-": {}
"^x-": {
}
},
"additionalProperties": false,
"not": {
@@ -1576,7 +1616,8 @@
"$ref": "#/definitions/PathItem"
},
"patternProperties": {
"^x-": {}
"^x-": {
}
}
},
"Encoding": {

View File

@@ -1,5 +1,5 @@
{
"$id": "https://spec.openapis.org/oas/3.1/schema/2022-02-27",
"$id": "https://spec.openapis.org/oas/3.1/schema/2022-10-07",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"description": "The description of OpenAPI v3.1.x documents without schema validation, as defined by https://spec.openapis.org/oas/v3.1.0",
"type": "object",
@@ -22,7 +22,9 @@
"$ref": "#/$defs/server"
},
"default": [
{ "url": "/" }
{
"url": "/"
}
]
},
"paths": {
@@ -148,18 +150,15 @@
"required": [
"name"
],
"oneOf": [
{
"required": [
"identifier"
]
},
{
"required": [
"url"
]
"dependentSchemas": {
"identifier": {
"not": {
"required": [
"url"
]
}
}
],
},
"$ref": "#/$defs/specification-extensions",
"unevaluatedProperties": false
},
@@ -319,10 +318,29 @@
"items": {
"$ref": "#/$defs/parameter-or-reference"
}
}
},
"patternProperties": {
"^(get|put|post|delete|options|head|patch|trace)$": {
},
"get": {
"$ref": "#/$defs/operation"
},
"put": {
"$ref": "#/$defs/operation"
},
"post": {
"$ref": "#/$defs/operation"
},
"delete": {
"$ref": "#/$defs/operation"
},
"options": {
"$ref": "#/$defs/operation"
},
"head": {
"$ref": "#/$defs/operation"
},
"patch": {
"$ref": "#/$defs/operation"
},
"trace": {
"$ref": "#/$defs/operation"
}
},
@@ -822,7 +840,16 @@
},
"minProperties": 1,
"$ref": "#/$defs/specification-extensions",
"unevaluatedProperties": false
"unevaluatedProperties": false,
"if": {
"$comment": "either default, or at least one response code property must exist",
"patternProperties": {
"^[1-5](?:[0-9]{2}|XX)$": false
}
},
"then" : {
"required": [ "default" ]
}
},
"response": {
"$comment": "https://spec.openapis.org/oas/v3.1.0#response-object",
@@ -936,7 +963,9 @@
"type": "string",
"format": "uri-reference"
},
"operationId": true,
"operationId": {
"type": "string"
},
"parameters": {
"$ref": "#/$defs/map-of-strings"
},