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

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

Open
jeremyfiel opened this issue Dec 12, 2024 · 0 comments

Comments

@jeremyfiel
Copy link

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: {} 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant