Skip to content

Response Headers #393

Closed
Closed
@jankuca

Description

@jankuca

The response headers defined in the OpenAPI document are lost. It would be great to be able to type-check them.

Two possibilities:

  1. (breaking change) Changing the format of the responses to include both content and headers:
responses: {
  [statusCode: number]: {
    content: { [contentType: string]: … },
    headers: { [name: string]: string }
  }
}
  1. (backwards-compatible change) Adding a separate field for response headers:
responses: {
  [statusCode: number]: { [contentType: string]: … }
},
responseHeaders: {
  [statusCode: number]: { [name: string]: string }
}

In the OpenAPI format, response headers are placed in the response objects such as

"responses": {
  [statusCode]: {
    "description": "…",
    "content": {
      [contentType]: …
    },
    "headers": { [name]: "…" }
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions