Skip to content
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

Documentation for OpenAPI's Header Object should be verbose #1965

Closed
shockey opened this issue Jun 29, 2019 · 5 comments
Closed

Documentation for OpenAPI's Header Object should be verbose #1965

shockey opened this issue Jun 29, 2019 · 5 comments
Assignees
Labels
clarification requests to clarify, but not change, part of the spec editorial Wording and stylistic issues
Milestone

Comments

@shockey
Copy link

shockey commented Jun 29, 2019

Context: I'm implementing support for examples in an OpenAPI tool.

I have a pretty good working knowledge of the Specification, but to make sure I didn't miss anything, I Cmd+F'd the 3.0.2 document for examples. and took note of which objects mention it. I missed Header Object in my list, because it only mentions that it derives itself from the Parameter Object, lacking a full documentation block that enumerates the keys that it supports.

I only noticed this because I was looking up Header Object specifically, for an unrelated task.

@handrews handrews added the clarification requests to clarify, but not change, part of the spec label Jan 28, 2024
@handrews
Copy link
Member

Probably a better way to solve this problem would be by looking at the schema (although it is currently in need of some help, or at least our schema publishing process is). But that's a place for explicit enumeration, while the spec is more for human readability.

@handrews handrews added editorial Wording and stylistic issues review labels May 24, 2024
@handrews
Copy link
Member

@OAI/tsc review request: do we want to repeat things in the Header Object section or leave it as-is?

@ralfhandl
Copy link
Contributor

Let's spell out explicitly which fixed fields a Header Object has, instead of requiring every reader to do the mental excercise:

The Header Object follows the structure of the Parameter Object with the following changes:

  1. name MUST NOT be specified, it is given in the corresponding headers map.
  2. in MUST NOT be specified, it is implicitly in header.
  3. All traits that are affected by the location MUST be applicable to a location of header (for example, style).

This already rules out half of the fixed fields of a parameter object, as our favorite allowEmptyValue already states that it only applies to query parameters 😄.

In recent Moonwalk discussions we figured out that headers and parameters are quite different beasts shaped by different boundary conditions, and these significant differences confirm our finding.

@darrelmiller
Copy link
Member

TDC decision to add a fixed fields table to make it clear which fields a header object has. Also valuable to call out where header fields are different than parameter fields.

@handrews
Copy link
Member

PR merged for 3.0.4 and ported to 3.1.1 via PR #3921!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clarification requests to clarify, but not change, part of the spec editorial Wording and stylistic issues
Projects
None yet
Development

No branches or pull requests

5 participants