Skip to content

Commit 42c153c

Browse files
more schema tweaks for parameter objects (OAI#2811)
* allowEmptyValue is valid only for query parameters https://spec.openapis.org/oas/v3.1.0#parameter-object we can't move this to the dependentSchemas section because that is only valid when "schema" is present. * allowReserved only applies to parameters with a value of query https://spec.openapis.org/oas/v3.1.0#parameter-object
1 parent af79cf0 commit 42c153c

File tree

2 files changed

+36
-15
lines changed

2 files changed

+36
-15
lines changed

schemas/v3.1/schema.json

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -440,10 +440,6 @@
440440
"default": false,
441441
"type": "boolean"
442442
},
443-
"allowEmptyValue": {
444-
"default": false,
445-
"type": "boolean"
446-
},
447443
"schema": {
448444
"$dynamicRef": "#meta"
449445
},
@@ -469,6 +465,24 @@
469465
]
470466
}
471467
],
468+
"if": {
469+
"properties": {
470+
"in": {
471+
"const": "query"
472+
}
473+
},
474+
"required": [
475+
"in"
476+
]
477+
},
478+
"then": {
479+
"properties": {
480+
"allowEmptyValue": {
481+
"default": false,
482+
"type": "boolean"
483+
}
484+
}
485+
},
472486
"dependentSchemas": {
473487
"schema": {
474488
"properties": {
@@ -477,10 +491,6 @@
477491
},
478492
"explode": {
479493
"type": "boolean"
480-
},
481-
"allowReserved": {
482-
"default": false,
483-
"type": "boolean"
484494
}
485495
},
486496
"allOf": [
@@ -578,6 +588,10 @@
578588
"pipeDelimited",
579589
"deepObject"
580590
]
591+
},
592+
"allowReserved": {
593+
"default": false,
594+
"type": "boolean"
581595
}
582596
}
583597
}

schemas/v3.1/schema.yaml

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -311,9 +311,6 @@ $defs:
311311
deprecated:
312312
default: false
313313
type: boolean
314-
allowEmptyValue:
315-
default: false
316-
type: boolean
317314
schema:
318315
$dynamicRef: '#meta'
319316
content:
@@ -328,16 +325,24 @@ $defs:
328325
- schema
329326
- required:
330327
- content
328+
if:
329+
properties:
330+
in:
331+
const: query
332+
required:
333+
- in
334+
then:
335+
properties:
336+
allowEmptyValue:
337+
default: false
338+
type: boolean
331339
dependentSchemas:
332340
schema:
333341
properties:
334342
style:
335343
type: string
336344
explode:
337345
type: boolean
338-
allowReserved:
339-
default: false
340-
type: boolean
341346
allOf:
342347
- $ref: '#/$defs/examples'
343348
- $ref: '#/$defs/parameter/dependentSchemas/schema/$defs/styles-for-path'
@@ -398,7 +403,9 @@ $defs:
398403
- spaceDelimited
399404
- pipeDelimited
400405
- deepObject
401-
406+
allowReserved:
407+
default: false
408+
type: boolean
402409
styles-for-cookie:
403410
if:
404411
properties:

0 commit comments

Comments
 (0)