swagger-api / swagger-api/swagger-ui

Response headers are not visible on swagger UI

Open
#10,377 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
29k
Forks
9.3k
Avg merge
2d 23h
Merged PRs (30d)
25

Description

Q&A (please complete the following information)
  • OS: Windows 11
  • Browser: chrome
  • Version: 134.0.6998.89
  • Method of installation: https://editor.swagger.io/
  • Swagger-UI version: N/A
  • Swagger/OpenAPI version: OpenAPI 3.0.1
Content & configuration

I have defined a header in the response section in the following way:

responses:
      "202":
          description: Accepted
          headers:
            x-resource-id:
              description: Job objects status Id
              schema:
                type: string
          content:
            application/json:
              schema:
                type: object

If I open the network tab, I can see the below response headers:

HTTP/1.1 202 Accepted
Server: awselb/2.0
Date: Wed, 19 Mar 2025 14:06:43 GMT
Content-Type: application/json
Content-Length: 0
Connection: keep-alive
Access-Control-Max-Age: 86400
Access-Control-Allow-Methods: OPTIONS, POST, GET, PUT, DELETE
Access-Control-Allow-Headers: *
Access-Control-Allow-Credentials: true
Access-Control-Allow-Origin: *
x-resource-id: 1165

But on the swagger UI I can only see the below headers:

Image

Describe the bug you're encountering

Described above

Expected behavior

The headers should be shown in response section

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

Reproduce the issue in Swagger UI using the supplied OpenAPI 3.0.1 response definition and compare the network response headers with the headers rendered in the response section. Trace the response-header display path and verify that the documented x-resource-id header appears when the response is shown.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, openapi
Domain
documentation, frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.