Skip to content

Commit 6a3ed91

Browse files
authored
fix(oas3): reply changes from canonical JSON Schema to our fork (#2764)
These changes affects OAS 3.0.x JSON Schema and it's validation. Refs #2762
1 parent fd95f3d commit 6a3ed91

File tree

1 file changed

+24
-15
lines changed

1 file changed

+24
-15
lines changed

src/plugins/json-schema-validator/oas3-schema.yaml

+24-15
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
2-
id: https://spec.openapis.org/oas/3.0/schema/2019-04-02
3-
"$schema": http://json-schema.org/draft-04/schema#
2+
id: https://spec.openapis.org/oas/3.0/schema/2021-08-12
3+
$schema: http://json-schema.org/draft-04/schema#
44
description: Validation schema for OpenAPI Specification 3.0.X.
55
type: object
66
required:
@@ -27,9 +27,9 @@ properties:
2727
type: array
2828
items:
2929
$ref: "#/definitions/Tag"
30-
### disabled, see
31-
### test/unit/plugins/json-schema-validator/test-documents/tag-object-uniqueness.yaml
32-
# uniqueItems: true
30+
### disabled, see
31+
### test/unit/plugins/json-schema-validator/test-documents/tag-object-uniqueness.yaml
32+
# uniqueItems: true
3333
paths:
3434
$ref: "#/definitions/Paths"
3535
components:
@@ -284,7 +284,7 @@ definitions:
284284
type: string
285285
minItems: 1
286286
uniqueItems: true
287-
errorMessage:
287+
errorMessage:
288288
type: "should be an array of property names required within an object schema"
289289
enum:
290290
type: array
@@ -364,11 +364,11 @@ definitions:
364364
required: [$ref]
365365
then:
366366
$ref: "#/definitions/Reference"
367-
- if:
367+
- if:
368368
type: object
369369
then:
370370
$ref: "#/definitions/Schema"
371-
- then:
371+
- then:
372372
type: boolean
373373
errorMessage: "should be a Reference Object, Schema Object, or boolean value"
374374
description:
@@ -675,7 +675,7 @@ definitions:
675675
$ref: "#/definitions/Response"
676676
patternProperties:
677677
"^[1-5](?:\\d{2}|XX)$":
678-
switch:
678+
switch:
679679
- if:
680680
required: [$ref]
681681
then:
@@ -739,7 +739,7 @@ definitions:
739739
description: Schema and content are mutually exclusive, at least one is required
740740
switch:
741741
- if:
742-
# fails mutual exclusion of `schema` and `content`
742+
# fails mutual exclusion of `schema` and `content`
743743
required:
744744
- schema
745745
- content
@@ -1070,7 +1070,8 @@ definitions:
10701070
PasswordOAuthFlow:
10711071
type: object
10721072
required:
1073-
- tokenUrl
1073+
- tokenUrl
1074+
- scopes
10741075
properties:
10751076
tokenUrl:
10761077
type: string
@@ -1088,7 +1089,8 @@ definitions:
10881089
ClientCredentialsFlow:
10891090
type: object
10901091
required:
1091-
- tokenUrl
1092+
- tokenUrl
1093+
- scopes
10921094
properties:
10931095
tokenUrl:
10941096
type: string
@@ -1106,8 +1108,9 @@ definitions:
11061108
AuthorizationCodeOAuthFlow:
11071109
type: object
11081110
required:
1109-
- authorizationUrl
1110-
- tokenUrl
1111+
- authorizationUrl
1112+
- tokenUrl
1113+
- scopes
11111114
properties:
11121115
authorizationUrl:
11131116
type: string
@@ -1163,7 +1166,13 @@ definitions:
11631166
headers:
11641167
type: object
11651168
additionalProperties:
1166-
$ref: "#/definitions/Header"
1169+
switch:
1170+
- if:
1171+
required: [$ref]
1172+
then:
1173+
$ref: "#/definitions/Reference"
1174+
- then:
1175+
$ref: "#/definitions/Header"
11671176
style:
11681177
type: string
11691178
enum:

0 commit comments

Comments
 (0)