Skip to content

Commit 24b3d5b

Browse files
authored
Merge pull request #4958 from karenetheridge/v3.1-dev
v3.1 schema edits
2 parents cdb1834 + 72de87b commit 24b3d5b

File tree

7 files changed

+20
-32
lines changed

7 files changed

+20
-32
lines changed

src/schemas/validation/schema.yaml

Lines changed: 16 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ $defs:
193193
additionalProperties:
194194
$ref: '#/$defs/path-item'
195195
patternProperties:
196-
'^(schemas|responses|parameters|examples|requestBodies|headers|securitySchemes|links|callbacks|pathItems)$':
196+
'^(?:schemas|responses|parameters|examples|requestBodies|headers|securitySchemes|links|callbacks|pathItems)$':
197197
$comment: Enumerating all of the property names in the regex above is necessary for unevaluatedProperties to work as expected
198198
propertyNames:
199199
pattern: '^[a-zA-Z0-9._-]+$'
@@ -341,8 +341,6 @@ $defs:
341341
properties:
342342
in:
343343
const: query
344-
required:
345-
- in
346344
then:
347345
properties:
348346
allowEmptyValue:
@@ -369,8 +367,6 @@ $defs:
369367
properties:
370368
in:
371369
const: path
372-
required:
373-
- in
374370
then:
375371
properties:
376372
style:
@@ -389,8 +385,6 @@ $defs:
389385
properties:
390386
in:
391387
const: header
392-
required:
393-
- in
394388
then:
395389
properties:
396390
style:
@@ -402,8 +396,6 @@ $defs:
402396
properties:
403397
in:
404398
const: query
405-
required:
406-
- in
407399
then:
408400
properties:
409401
style:
@@ -422,8 +414,6 @@ $defs:
422414
properties:
423415
in:
424416
const: cookie
425-
required:
426-
- in
427417
then:
428418
properties:
429419
style:
@@ -504,7 +494,6 @@ $defs:
504494
additionalProperties:
505495
$ref: '#/$defs/header-or-reference'
506496
style:
507-
default: form
508497
enum:
509498
- form
510499
- spaceDelimited
@@ -513,8 +502,22 @@ $defs:
513502
explode:
514503
type: boolean
515504
allowReserved:
516-
default: false
517505
type: boolean
506+
dependentSchemas:
507+
style:
508+
properties:
509+
allowReserved:
510+
default: false
511+
explode:
512+
properties:
513+
style:
514+
default: form
515+
allowReserved:
516+
default: false
517+
allowReserved:
518+
properties:
519+
style:
520+
default: form
518521
allOf:
519522
- $ref: '#/$defs/specification-extensions'
520523
- $ref: '#/$defs/styles-for-form'
@@ -760,8 +763,6 @@ $defs:
760763
properties:
761764
type:
762765
const: apiKey
763-
required:
764-
- type
765766
then:
766767
properties:
767768
name:
@@ -780,8 +781,6 @@ $defs:
780781
properties:
781782
type:
782783
const: http
783-
required:
784-
- type
785784
then:
786785
properties:
787786
scheme:
@@ -810,8 +809,6 @@ $defs:
810809
properties:
811810
type:
812811
const: oauth2
813-
required:
814-
- type
815812
then:
816813
properties:
817814
flows:
@@ -824,8 +821,6 @@ $defs:
824821
properties:
825822
type:
826823
const: openIdConnect
827-
required:
828-
- type
829824
then:
830825
properties:
831826
openIdConnectUrl:

tests/schema/fail/example-examples.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,3 @@ components:
1515
examples:
1616
a mammalian example:
1717
value: bear
18-
19-
20-

tests/schema/fail/invalid_schema_types.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,3 @@ components:
1010
invalid_null: null
1111
invalid_number: 0
1212
invalid_array: []
13-

tests/schema/pass/example-object-examples.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ components:
2929
summary: This is a text example
3030
externalValue: https://foo.bar/examples/address-example.txt
3131
parameters:
32-
with-example:
32+
with-example:
3333
name: zipCode
3434
in: query
3535
schema:

tests/schema/pass/schema-object-deprecated-example-keyword.yaml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ paths:
1212
# the example simple
1313
type: object
1414
# DEPRECATED: don't use example keyword inside Schema Object
15-
example: {
16-
"numbers": [1, 2],
17-
"flag": null
18-
}
15+
example:
16+
numbers: [1, 2]
17+
flag: null

tests/schema/pass/valid_schema_types.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,3 @@ components:
1111
nothing_boolean: false
1212
anything_object: {}
1313
nothing_object: { not: {} }
14-

tests/schema/pass/webhook-example.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,3 @@ components:
3232
type: string
3333
tag:
3434
type: string
35-

0 commit comments

Comments
 (0)