v3.1: edits to parameter sections#5198
Open
karenetheridge wants to merge 10 commits intoOAI:v3.1-devfrom
Open
Conversation
this was added in commit 9739dfe, but now that the leading "?" has been removed, this is no longer needed
..such as an empty array or object
0bfe8b3 to
b6aad67
Compare
…ts with in:query (this was changed in 3.2.0 to allow it wherever percent-encoding is done)
… objects
- explode defaults were wrong 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" ("style: form" is the only option, and
defaults 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
…ll defaults omitted
tested with:
$ openapi-validate --with-defaults tests/schema/pass/style-defaults.yaml
{
"defaults" : {
"/components/parameters/cookie_form/deprecated" : false,
"/components/parameters/cookie_form/explode" : true,
"/components/parameters/cookie_form/required" : false,
"/components/parameters/cookie_form/style" : "form",
"/components/parameters/cookie_media_type/deprecated" : false,
"/components/parameters/cookie_media_type/required" : false,
"/components/parameters/encoding_object_defaults/content/encoding_object_defaults/encoding/allowReserved/explode" : true,
"/components/parameters/encoding_object_defaults/content/encoding_object_defaults/encoding/allowReserved/style" : "form",
"/components/parameters/encoding_object_defaults/content/encoding_object_defaults/encoding/explode/allowReserved" : false,
"/components/parameters/encoding_object_defaults/content/encoding_object_defaults/encoding/explode/style" : "form",
"/components/parameters/encoding_object_defaults/content/encoding_object_defaults/encoding/style_form/allowReserved" : false,
"/components/parameters/encoding_object_defaults/content/encoding_object_defaults/encoding/style_form/explode" : true,
"/components/parameters/encoding_object_defaults/content/encoding_object_defaults/encoding/style_spaceDelimited/allowReserved" : false,
"/components/parameters/encoding_object_defaults/content/encoding_object_defaults/encoding/style_spaceDelimited/explode" : false,
"/components/parameters/encoding_object_defaults/deprecated" : false,
"/components/parameters/encoding_object_defaults/required" : false,
"/components/parameters/header/deprecated" : false,
"/components/parameters/header/explode" : false,
"/components/parameters/header/style" : "simple",
"/components/parameters/path_label/deprecated" : false,
"/components/parameters/path_label/explode" : false,
"/components/parameters/path_matrix/deprecated" : false,
"/components/parameters/path_matrix/explode" : false,
"/components/parameters/path_media_type/deprecated" : false,
"/components/parameters/path_simple/deprecated" : false,
"/components/parameters/path_simple/explode" : false,
"/components/parameters/path_simple/style" : "simple",
"/components/parameters/query_deepObject/allowEmptyValue" : false,
"/components/parameters/query_deepObject/allowReserved" : false,
"/components/parameters/query_deepObject/deprecated" : false,
"/components/parameters/query_deepObject/explode" : false,
"/components/parameters/query_deepObject/required" : false,
"/components/parameters/query_form/allowEmptyValue" : false,
"/components/parameters/query_form/allowReserved" : false,
"/components/parameters/query_form/deprecated" : false,
"/components/parameters/query_form/explode" : true,
"/components/parameters/query_form/required" : false,
"/components/parameters/query_form/style" : "form",
"/components/parameters/query_media_type/allowEmptyValue" : false,
"/components/parameters/query_media_type/deprecated" : false,
"/components/parameters/query_media_type/required" : false,
"/components/parameters/query_pipeDelimited/allowEmptyValue" : false,
"/components/parameters/query_pipeDelimited/allowReserved" : false,
"/components/parameters/query_pipeDelimited/deprecated" : false,
"/components/parameters/query_pipeDelimited/explode" : false,
"/components/parameters/query_pipeDelimited/required" : false,
"/components/parameters/query_spaceDelimited/allowEmptyValue" : false,
"/components/parameters/query_spaceDelimited/allowReserved" : false,
"/components/parameters/query_spaceDelimited/deprecated" : false,
"/components/parameters/query_spaceDelimited/explode" : false,
"/components/parameters/query_spaceDelimited/required" : false,
"/jsonSchemaDialect" : "https://spec.openapis.org/oas/3.1/dialect/WORK-IN-PROGRESS",
"/servers" : [
{
"url" : "/"
}
]
},
"valid" : true
}
(executable is part of https://github.com/karenetheridge/OpenAPI-Modern)
For the Appendix C.4 example, "words" is said to not explode its values.
..and remove example that is specific to a particular style, explode and schema type configuration
b6aad67 to
e890239
Compare
miqui
approved these changes
Feb 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport of #5122 from v3.3-dev and #5196 from from v3.2-dev, adjusted with the following changes for 3.1:
allowReservedis only permitted in query parameters and the encoding object (not also inin: pathandin: cookie, style: form).in: querystringandstyle: cookieVarious fixes and wording clarifications to the sections discussing parameters.