Redocly / Redocly/redoc

Support for `content` in Response headers on UI, add mediatype to Header Parameters

Open
#2,632 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

help wanted p2 Type: Enhancement
Dominant language
TypeScript
Stars
25.9k
Forks
2.4k
Avg merge
13h 10m
Merged PRs (30d)
4

Description

Describe the problem to be solved
The current UI does not display the schema from a content keyword defined in Response headers.

Image


If I use the same structure in Parameters, it seems to work as expected but it's missing the content type definition.

Image


This small description should be derived from the mediatype mapping name
Image

I think a reasonable location for this is just below the header/parameter name
Image

Describe the solution you'd like

Display it similar to the Parameters section, with the media type and the schema definition.

Describe alternatives you've considered
none

Additional context

OpenAPI 3.1.1 example
openapi: 3.1.0
info:
  title: Example
  version: '0.0.1'
servers:
  - url: https://example.org
paths:
  '/foo/{example}':
    get:
      description: a sample URI
      parameters:
        - name: x-my-header
          in: header
          description: my custom header definition
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  additionalProperties: false
                  properties:
                    level:
                      enum:
                      - info
                      - warn
                      - error
                    message:
                      type: string
      responses:
        '200':
          description: OK
          headers:
            x-my-header:
              description: my custom header definition
              content:
                application/json:
                  schema:
                    type: array
                    items:
                      type: object
                      additionalProperties: false
                      properties:
                        level:
                          enum:
                          - info
                          - warn
                          - error
                        message:
                          type: string
          content:
            'application/json':
              schema: {}
        '400':
          description: Bad Request
          content: 
            'application/json':
              schema: {} 

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 reproducing the example in the Response headers UI and compare its rendering with the Parameters section. Trace the Response header rendering path and verify that a content media type and its schema appear below the header name, matching the requested behavior.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.