From b24dda8da95cab895f2621b6aa37fc8e49e210ee Mon Sep 17 00:00:00 2001 From: Jason Desrosiers Date: Mon, 20 Sep 2021 11:44:13 -0700 Subject: [PATCH 1/6] Update 3.1 schema id for patch release --- schemas/v3.1/schema-base.json | 6 +++--- schemas/v3.1/schema-base.yaml | 4 ++-- schemas/v3.1/schema.json | 4 ++-- schemas/v3.1/schema.yaml | 2 +- tests/v3.1/test.js | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/schemas/v3.1/schema-base.json b/schemas/v3.1/schema-base.json index 9796fa3851..03692f631a 100644 --- a/schemas/v3.1/schema-base.json +++ b/schemas/v3.1/schema-base.json @@ -1,7 +1,7 @@ { - "$id": "https://spec.openapis.org/oas/3.1/schema-base/2021-05-20", + "$id": "https://spec.openapis.org/oas/3.1/schema-base/2021-09-28", "$schema": "https://json-schema.org/draft/2020-12/schema", - "$ref": "https://spec.openapis.org/oas/3.1/schema/2021-05-20", + "$ref": "https://spec.openapis.org/oas/3.1/schema/2021-09-28", "properties": { "jsonSchemaDialect": { "$ref": "#/$defs/dialect" @@ -21,4 +21,4 @@ } } } -} +} \ No newline at end of file diff --git a/schemas/v3.1/schema-base.yaml b/schemas/v3.1/schema-base.yaml index a5f0d6bd80..59b43a8531 100644 --- a/schemas/v3.1/schema-base.yaml +++ b/schemas/v3.1/schema-base.yaml @@ -1,7 +1,7 @@ -$id: 'https://spec.openapis.org/oas/3.1/schema-base/2021-05-20' +$id: 'https://spec.openapis.org/oas/3.1/schema-base/2021-09-28' $schema: 'https://json-schema.org/draft/2020-12/schema' -$ref: 'https://spec.openapis.org/oas/3.1/schema/2021-05-20' +$ref: 'https://spec.openapis.org/oas/3.1/schema/2021-09-28' properties: jsonSchemaDialect: $ref: '#/$defs/dialect' diff --git a/schemas/v3.1/schema.json b/schemas/v3.1/schema.json index fe969143b9..ee88c25f20 100644 --- a/schemas/v3.1/schema.json +++ b/schemas/v3.1/schema.json @@ -1,5 +1,5 @@ { - "$id": "https://spec.openapis.org/oas/3.1/schema/2021-05-20", + "$id": "https://spec.openapis.org/oas/3.1/schema/2021-09-28", "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { @@ -1348,4 +1348,4 @@ } } } -} +} \ No newline at end of file diff --git a/schemas/v3.1/schema.yaml b/schemas/v3.1/schema.yaml index aac4bab56b..a36e69943a 100644 --- a/schemas/v3.1/schema.yaml +++ b/schemas/v3.1/schema.yaml @@ -1,4 +1,4 @@ -$id: 'https://spec.openapis.org/oas/3.1/schema/2021-05-20' +$id: 'https://spec.openapis.org/oas/3.1/schema/2021-09-28' $schema: 'https://json-schema.org/draft/2020-12/schema' type: object diff --git a/tests/v3.1/test.js b/tests/v3.1/test.js index 8fef3a6543..5e9dc31104 100644 --- a/tests/v3.1/test.js +++ b/tests/v3.1/test.js @@ -14,7 +14,7 @@ before(async () => { JsonSchema.add(dialect); JsonSchema.add(vocabulary); JsonSchema.add(yaml.parse(fs.readFileSync(`${__dirname}/../../schemas/v3.1/schema.yaml`, "utf8"), { prettyErrors: true })); - metaSchema = await JsonSchema.get("https://spec.openapis.org/oas/3.1/schema/2021-05-20"); + metaSchema = await JsonSchema.get("https://spec.openapis.org/oas/3.1/schema/2021-09-28"); }); describe("v3.1 Pass", () => { From 5d57ec0a811e4d3092f053e039bbd9c0f9a7a2fc Mon Sep 17 00:00:00 2001 From: Jason Desrosiers Date: Tue, 28 Sep 2021 10:14:48 -0700 Subject: [PATCH 2/6] Generate JSON for new version of 3.1 schemas --- schemas/v3.1/schema.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/schemas/v3.1/schema.json b/schemas/v3.1/schema.json index ee88c25f20..04940fcb34 100644 --- a/schemas/v3.1/schema.json +++ b/schemas/v3.1/schema.json @@ -622,6 +622,7 @@ }, "parameter-or-reference": { "if": { + "type": "object", "required": [ "$ref" ] @@ -865,6 +866,7 @@ }, "example-or-reference": { "if": { + "type": "object", "required": [ "$ref" ] @@ -1131,7 +1133,8 @@ "const": "http" }, "scheme": { - "const": "bearer" + "type": "string", + "pattern": "^[Bb][Ee][Aa][Rr][Ee][Rr]$" } }, "required": [ @@ -1144,10 +1147,7 @@ "bearerFormat": { "type": "string" } - }, - "required": [ - "scheme" - ] + } } }, "type-oauth2": { From c0bcdb4bdf3591026f504af75b7898e37a3b4181 Mon Sep 17 00:00:00 2001 From: Jason Desrosiers Date: Tue, 28 Sep 2021 10:41:47 -0700 Subject: [PATCH 3/6] Catchup v3.0 schema with #2158 --- schemas/v3.0/schema.json | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/schemas/v3.0/schema.json b/schemas/v3.0/schema.json index 71808402f6..44e5609c66 100644 --- a/schemas/v3.0/schema.json +++ b/schemas/v3.0/schema.json @@ -1628,7 +1628,14 @@ "headers": { "type": "object", "additionalProperties": { - "$ref": "#/definitions/Header" + "oneOf": [ + { + "$ref": "#/definitions/Header" + }, + { + "$ref": "#/definitions/Reference" + } + ] } }, "style": { From 4ed00084d79163a53377a8146844a9e4ada2bb9c Mon Sep 17 00:00:00 2001 From: Jason Desrosiers Date: Tue, 28 Sep 2021 10:46:53 -0700 Subject: [PATCH 4/6] Catchup v3.0 schemas with #2673 --- schemas/v3.0/schema.json | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/schemas/v3.0/schema.json b/schemas/v3.0/schema.json index 44e5609c66..33fe180a60 100644 --- a/schemas/v3.0/schema.json +++ b/schemas/v3.0/schema.json @@ -1489,7 +1489,8 @@ "PasswordOAuthFlow": { "type": "object", "required": [ - "tokenUrl" + "tokenUrl", + "scopes" ], "properties": { "tokenUrl": { @@ -1516,7 +1517,8 @@ "ClientCredentialsFlow": { "type": "object", "required": [ - "tokenUrl" + "tokenUrl", + "scopes" ], "properties": { "tokenUrl": { @@ -1544,7 +1546,8 @@ "type": "object", "required": [ "authorizationUrl", - "tokenUrl" + "tokenUrl", + "scopes" ], "properties": { "authorizationUrl": { From 0f78803e9ad3df61c2d7b71c0c05913e85deb42b Mon Sep 17 00:00:00 2001 From: Jason Desrosiers Date: Tue, 28 Sep 2021 10:47:48 -0700 Subject: [PATCH 5/6] Catchup v3.0 schemas with #2706 --- schemas/v3.0/schema.json | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/schemas/v3.0/schema.json b/schemas/v3.0/schema.json index 33fe180a60..b5cd03cf2d 100644 --- a/schemas/v3.0/schema.json +++ b/schemas/v3.0/schema.json @@ -1358,9 +1358,8 @@ "description": "Bearer", "properties": { "scheme": { - "enum": [ - "bearer" - ] + "type": "string", + "pattern": "^[Bb][Ee][Aa][Rr][Ee][Rr]$" } } }, @@ -1374,9 +1373,8 @@ "properties": { "scheme": { "not": { - "enum": [ - "bearer" - ] + "type": "string", + "pattern": "^[Bb][Ee][Aa][Rr][Ee][Rr]$" } } } From 6d50a73bb91fb7d214689b3fb2b7e0d3b08a79c1 Mon Sep 17 00:00:00 2001 From: Jason Desrosiers Date: Tue, 28 Sep 2021 10:48:37 -0700 Subject: [PATCH 6/6] Update schema id for 3.0 release --- schemas/v3.0/schema.json | 4 ++-- schemas/v3.0/schema.yaml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/schemas/v3.0/schema.json b/schemas/v3.0/schema.json index b5cd03cf2d..dadd2837eb 100644 --- a/schemas/v3.0/schema.json +++ b/schemas/v3.0/schema.json @@ -1,5 +1,5 @@ { - "id": "https://spec.openapis.org/oas/3.0/schema/2019-04-02", + "id": "https://spec.openapis.org/oas/3.0/schema/2021-09-28", "$schema": "http://json-schema.org/draft-04/schema#", "description": "Validation schema for OpenAPI Specification 3.0.X.", "type": "object", @@ -1659,4 +1659,4 @@ "additionalProperties": false } } -} \ No newline at end of file +} diff --git a/schemas/v3.0/schema.yaml b/schemas/v3.0/schema.yaml index babc5c5f37..2bee05d9a0 100644 --- a/schemas/v3.0/schema.yaml +++ b/schemas/v3.0/schema.yaml @@ -1,4 +1,4 @@ -id: https://spec.openapis.org/oas/3.0/schema/2021-08-12 +id: https://spec.openapis.org/oas/3.0/schema/2021-09-28 $schema: http://json-schema.org/draft-04/schema# description: Validation schema for OpenAPI Specification 3.0.X. type: object