Skip to content

Commit d44be38

Browse files
fix style, explode, allowReserved defaults for parameter and encoding objects
- explode defaults were wrong for in: cookie, style: cookie, and for encoding object - allowReserved defaults were wrong for encoding object in parameter objects: - explode: always false for "in: path", "in: header" - explode: always true for "in: cookie" (both "style: form" and "style: cookie" default to "explode: true") - explode: only true for "in: query" when "style: form" (the default style for this location) in encoding objects: - style: default is "form", but only when "explode" or "allowReserved" are present - explode: default is true when "style: form" (the default style) and otherwise false, and not included at all unless "style" or "allowReserved" are present - allowReserved: default is false, but only when "style" or "explode" are present that is: when none of style, explode or allowReserved are present, "contentType" is used (or a default is calculated), so none of style, explode or allowReserved shall have default values
1 parent b58ca10 commit d44be38

1 file changed

Lines changed: 15 additions & 7 deletions

File tree

src/schemas/validation/schema.yaml

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,6 @@ $defs:
426426
- $ref: '#/$defs/parameter/dependentSchemas/schema/$defs/styles-for-header'
427427
- $ref: '#/$defs/parameter/dependentSchemas/schema/$defs/styles-for-query'
428428
- $ref: '#/$defs/parameter/dependentSchemas/schema/$defs/styles-for-cookie'
429-
- $ref: '#/$defs/styles-for-form'
430429

431430
$defs:
432431
styles-for-path:
@@ -446,6 +445,8 @@ $defs:
446445
- simple
447446
required:
448447
const: true
448+
explode:
449+
default: false
449450
allowReserved:
450451
type: boolean
451452
default: false
@@ -462,6 +463,8 @@ $defs:
462463
style:
463464
default: simple
464465
const: simple
466+
explode:
467+
default: false
465468

466469
styles-for-query:
467470
if:
@@ -480,6 +483,7 @@ $defs:
480483
allowReserved:
481484
type: boolean
482485
default: false
486+
$ref: '#/$defs/explode-for-form'
483487

484488
styles-for-cookie:
485489
if:
@@ -493,6 +497,8 @@ $defs:
493497
enum:
494498
- form
495499
- cookie
500+
explode:
501+
default: true
496502
if:
497503
properties:
498504
style:
@@ -502,6 +508,7 @@ $defs:
502508
allowReserved:
503509
type: boolean
504510
default: false
511+
$ref: '#/$defs/explode-for-form'
505512

506513
unevaluatedProperties: false
507514

@@ -610,7 +617,6 @@ $defs:
610617
type: boolean
611618
allowReserved:
612619
type: boolean
613-
default: false
614620
encoding:
615621
type: object
616622
additionalProperties:
@@ -627,7 +633,10 @@ $defs:
627633
prefixEncoding: false
628634
itemEncoding: false
629635
style:
630-
$ref: '#/$defs/styles-for-form'
636+
properties:
637+
allowReserved:
638+
default: false
639+
$ref: '#/$defs/explode-for-form'
631640
explode:
632641
properties:
633642
style:
@@ -638,7 +647,7 @@ $defs:
638647
properties:
639648
style:
640649
default: form
641-
$ref: '#/$defs/styles-for-form'
650+
$ref: '#/$defs/explode-for-form'
642651
$ref: '#/$defs/specification-extensions'
643652
unevaluatedProperties: false
644653

@@ -1127,13 +1136,12 @@ $defs:
11271136
additionalProperties:
11281137
type: string
11291138

1130-
styles-for-form:
1139+
explode-for-form:
1140+
$comment: for encoding objects, and query and cookie parameters, style=form is the default
11311141
if:
11321142
properties:
11331143
style:
11341144
const: form
1135-
required:
1136-
- style
11371145
then:
11381146
properties:
11391147
explode:

0 commit comments

Comments
 (0)