OAI / OAI/OpenAPI-Specification

Share header with multiple response objects

Open
#369 13 comments 13 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

re-use: globals/defaults
Dominant language
Markdown
Stars
31.2k
Forks
9.2k
Avg merge
6h 37m
Merged PRs (30d)
27

Description

Can there not just be a simple header generically at the response level not specific to each of the status codes? For our case, this kind of header is 99% the same across our codebase.


---

responses:
  200:
    description: no error
    headers:
      Content-Type:
        description: application/json
        type: string

It would be a pain to copy+paste this to each and every routine that supports HTTP JSON responses.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the response object rules in the OpenAPI Specification repository and compare how headers are currently defined under individual status codes. Define the valid scope and structure for a shared response-level header, then update the relevant specification text and examples so the feature's behavior is unambiguous.

Written by the indexing model from the issue text.

Assessment

Tech stack
openapi
Domain
api
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.