Skip to content

v3.3: parameter style amendments#5080

Merged
handrews merged 5 commits intoOAI:v3.3-devfrom
karenetheridge:ether/3.3-parameter-styles
Oct 30, 2025
Merged

v3.3: parameter style amendments#5080
handrews merged 5 commits intoOAI:v3.3-devfrom
karenetheridge:ether/3.3-parameter-styles

Conversation

@karenetheridge
Copy link
Copy Markdown
Member

@karenetheridge karenetheridge commented Oct 28, 2025

I have been working through the parameter templating section and filling in some of the styles that I had not previously implemented, and cross-checking against RFC6570, and I found these issues with the "in: path" styles.

Each commit explains the reasoning for the change.

I made the changes against v3.3-dev, but I think they could probably go back to 3.1 and 3.2 as well?

  • no schema changes are needed for this pull request

RFC6570 section 3.2.1 says:
"A variable that is undefined (Section 2.3) has no value and is ignored by the
expansion process.  If all of the variables in an expression are undefined,
then the expression's expansion is the empty string."

..therefore the provided examples for the "matrix" and "label" styles are
incorrect -- the full expansion is the empty string, with no leader/prefix.
@karenetheridge karenetheridge requested review from a team as code owners October 28, 2025 19:43
@karenetheridge karenetheridge added this to the v3.3.0 milestone Oct 28, 2025
Comment thread src/oas.md Outdated
Comment thread src/oas.md
Expansions using "style": "simple", "explode": true do not include the
parameter name in the expansion.
@karenetheridge karenetheridge force-pushed the ether/3.3-parameter-styles branch from 8ef7aab to bd97d2e Compare October 28, 2025 23:11
@karenetheridge
Copy link
Copy Markdown
Member Author

edits pushed, as discussed.

@handrews handrews merged commit c979c5a into OAI:v3.3-dev Oct 30, 2025
2 checks passed
@karenetheridge karenetheridge deleted the ether/3.3-parameter-styles branch October 30, 2025 16:34
karenetheridge added a commit to karenetheridge/OpenAPI-Modern that referenced this pull request Jan 26, 2026
… and RFC6570

- simple, matrix and label styles fully supported
- parsing as arrays and objects now supported via hints from the schema "type"
  keyword

Some previously-todo test cases have been corrected to match the examples in
the spec at https://spec.openapis.org/oas/v3.2.0#parameter-object.

In addition, some corrections to the OAS regarding null values have been made,
given inconsistencies with RFC6570; see
OAI/OpenAPI-Specification#5080

RFC6570 3.2.2 (style=simple):
For each defined variable in the variable-list, perform variable
expansion, as defined in Section 3.2.1, with the allowed characters
being those in the unreserved set.  If more than one variable has a
defined value, append a comma (",") to the result string as a
separator between variable expansions.

RFC6570 3.2.5 (style=label):
For each defined variable in the variable-list, append "." to the
result string and then perform variable expansion, as defined in
Section 3.2.1, with the allowed characters being those in the
unreserved set.

RFC6570 3.2.7 (style=matrix):
For each defined variable in the variable-list:
   o  append ";" to the result string;
   o  if the variable has a simple string value or no explode modifier
      is given, then:
      *  append the variable name (encoded as if it were a literal
         string) to the result string;
      *  if the variable's value is not empty, append "=" to the result
         string;
   o  perform variable expansion, as defined in Section 3.2.1, with the
      allowed characters being those in the unreserved set.

RFC6570 3.2.1 (applies to all styles):
A variable that is undefined (Section 2.3) has no value and is
ignored by the expansion process.  If all of the variables in an
expression are undefined, then the expression's expansion is the
empty string.

For a variable that is a list of values, expansion depends on both
the expression type and the presence of an explode modifier.  If
there is no explode modifier, the expansion consists of a comma-
separated concatenation of the defined member string values.  If
there is an explode modifier and the expression type expands named
parameters (";", "?", or "&"), then the list is expanded as if it
were an associative array in which each member value is paired with
the list's varname. Otherwise, the value will be expanded as if it
were a list of separate variable values, each value separated by the
expression type's associated separator as defined by the table above.

For a variable that is an associative array, expansion depends on
both the expression type and the presence of an explode modifier.  If
there is no explode modifier, expansion consists of appending a
comma-separated concatenation of each (name, value) pair that has a
defined value.  If there is an explode modifier, expansion consists
of appending each pair that has a defined value as either
"name=value" or, if the value is the empty string and the expression
type does not indicate form-style parameters (i.e., not a "?" or "&"
type), simply "name".  Both name and value strings are encoded in the
same way as simple string values.  A separator string is appended
between defined pairs[.]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants