Skip to content

Commit

Permalink
more schema tweaks for parameter objects (#2811)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
karenetheridge authored Dec 29, 2021
1 parent af79cf0 commit 42c153c
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 15 deletions.
30 changes: 22 additions & 8 deletions schemas/v3.1/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -440,10 +440,6 @@
"default": false,
"type": "boolean"
},
"allowEmptyValue": {
"default": false,
"type": "boolean"
},
"schema": {
"$dynamicRef": "#meta"
},
Expand All @@ -469,6 +465,24 @@
]
}
],
"if": {
"properties": {
"in": {
"const": "query"
}
},
"required": [
"in"
]
},
"then": {
"properties": {
"allowEmptyValue": {
"default": false,
"type": "boolean"
}
}
},
"dependentSchemas": {
"schema": {
"properties": {
Expand All @@ -477,10 +491,6 @@
},
"explode": {
"type": "boolean"
},
"allowReserved": {
"default": false,
"type": "boolean"
}
},
"allOf": [
Expand Down Expand Up @@ -578,6 +588,10 @@
"pipeDelimited",
"deepObject"
]
},
"allowReserved": {
"default": false,
"type": "boolean"
}
}
}
Expand Down
21 changes: 14 additions & 7 deletions schemas/v3.1/schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -311,9 +311,6 @@ $defs:
deprecated:
default: false
type: boolean
allowEmptyValue:
default: false
type: boolean
schema:
$dynamicRef: '#meta'
content:
Expand All @@ -328,16 +325,24 @@ $defs:
- schema
- required:
- content
if:
properties:
in:
const: query
required:
- in
then:
properties:
allowEmptyValue:
default: false
type: boolean
dependentSchemas:
schema:
properties:
style:
type: string
explode:
type: boolean
allowReserved:
default: false
type: boolean
allOf:
- $ref: '#/$defs/examples'
- $ref: '#/$defs/parameter/dependentSchemas/schema/$defs/styles-for-path'
Expand Down Expand Up @@ -398,7 +403,9 @@ $defs:
- spaceDelimited
- pipeDelimited
- deepObject

allowReserved:
default: false
type: boolean
styles-for-cookie:
if:
properties:
Expand Down

0 comments on commit 42c153c

Please sign in to comment.