more schema tweaks for parameter objects
* allowEmptyValue is valid only for query parameters
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
MODIFY
schemas/v3.1/schema.json
schemas/v3.1/schema.json
"default": false,
"type": "boolean"
},
- "allowEmptyValue": {
- "default": false,
- "type": "boolean"
- },
"schema": {
"$dynamicRef": "#meta"
},
]
}
],
+ "if": {
+ "properties": {
+ "in": {
+ "const": "query"
+ }
+ },
+ "required": [
+ "in"
+ ]
+ },
+ "then": {
+ "properties": {
+ "allowEmptyValue": {
+ "default": false,
+ "type": "boolean"
+ }
+ }
+ },
"dependentSchemas": {
"schema": {
"properties": {
},
"explode": {
"type": "boolean"
- },
- "allowReserved": {
- "default": false,
- "type": "boolean"
}
},
"allOf": [
"pipeDelimited",
"deepObject"
]
+ },
+ "allowReserved": {
+ "default": false,
+ "type": "boolean"
}
}
}

MODIFY
schemas/v3.1/schema.yaml
schemas/v3.1/schema.yaml
@@ -311,9 +311,6 @@ $defs:
deprecated:
default: false
type: boolean
- allowEmptyValue:
- default: false
- type: boolean
schema:
$dynamicRef: '#meta'
content:
@@ -328,6 +325,17 @@ $defs:
- schema
- required:
- content
+ if:
+ properties:
+ in:
+ const: query
+ required:
+ - in
+ then:
+ properties:
+ allowEmptyValue:
+ default: false
+ type: boolean
dependentSchemas:
schema:
properties:
@@ -335,9 +343,6 @@ $defs:
type: string
explode:
type: boolean
- allowReserved:
- default: false
- type: boolean
allOf:
- $ref: '#/$defs/examples'
- $ref: '#/$defs/parameter/dependentSchemas/schema/$defs/styles-for-path'
@@ -398,7 +403,9 @@ $defs:
- spaceDelimited
- pipeDelimited
- deepObject
-
+ allowReserved:
+ default: false
+ type: boolean
styles-for-cookie:
if:
properties:

more schema tweaks for parameter objects (#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