Skip to content

v3.2: Parameter and Header example updates #4801

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: v3.2-dev
Choose a base branch
from

Conversation

handrews
Copy link
Member

@handrews handrews commented Jul 18, 2025

Note: This replaces the other half of PR #4673 (the first half being replaced by PR #4800), and updates parameter and header examples for PRs #4800, #4799., and #4802.

This updates for both the new example fields and for examples with content

  • schema changes are included in this pull request
  • schema changes are needed for this pull request but not done yet
  • no schema changes are needed for this pull request

This updates for both the new example fields and for examples with `content`
@handrews handrews added this to the v3.2.0 milestone Jul 18, 2025
@handrews handrews requested review from a team as code owners July 18, 2025 21:52
@handrews handrews added examples requests for more or better examples in the specification param serialization Issues related to parameter and/or header serialization media and encoding Issues regarding media type support and how to encode data (outside of query/path params) example obj/keywords Issues with the Example Object or exampel(s) keywords labels Jul 18, 2025
@ralfhandl ralfhandl requested a review from a team July 19, 2025 14:43
miqui
miqui previously approved these changes Jul 19, 2025
@ralfhandl ralfhandl requested a review from a team July 19, 2025 15:08
@handrews
Copy link
Member Author

@ralfhandl the email notification contained this:

In src/oas.md:

@@ -1183,11 +1273,14 @@ content:
schema:
type: string
example: $.a.b[1:1]
+examples:
examples and example can currently only be used with schema, not with content, see https://github.com/OAI/OpenAPI-Specification/blob/v3.2-dev/src/oas.md#fixed-fields-for-use-with-content.

This affects multiple examples :sad:

but I don't see it now... was this just because I had split this from PR #4802? (and accidentally posted them in the wrong order...)

@handrews handrews requested a review from a team July 19, 2025 15:58
@ralfhandl
Copy link
Contributor

Yes, I got confused for a minute and lost sight of the target picture.

src/oas.md Outdated
@@ -2545,6 +2638,7 @@ ETag:
schema:
type: string
pattern: ^"
example: xyzzx
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don’t understand why the example does not match the pattern required by the schema.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LOL neither do I 🤦

Copy link
Member Author

@handrews handrews Jul 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ralfhandl OK so it turns out the ETag header makes strange use of quotes, and I'm not really sure how to represent it. Here are examples from RFC9110:

ETag: "xyzzy"
ETag: W/"xyzzy"
ETag: ""

I was trying to ensure the first or third would be valid, but the second would not be. Which I guess means that unlike most headers where you strip the quotes (the quoted-string ABNF production), the quotes are significant in the ETag? I think?

So I think maybe this should be pattern: ^" and example: "\"xyzzy\""? Or maybe I should find a different example? I just want an example of a real header....

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ralfhandl I updated it with that approach and added a comment about the unusual quote use.... I am open to dropping this as too confusing but it's actually a semantically significant documentation use case.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(I have no idea if anyone would use this in an actual OAD, but it does tell you something useful).

@ralfhandl ralfhandl requested review from miqui and a team July 19, 2025 18:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
example obj/keywords Issues with the Example Object or exampel(s) keywords examples requests for more or better examples in the specification headers media and encoding Issues regarding media type support and how to encode data (outside of query/path params) param serialization Issues related to parameter and/or header serialization
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants