swagger-api / swagger-api/swagger-ui

Schema not rendered for query parameter

Open
#7,696 4 comments 5 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: Linux
  • Browser: chrome
  • Version: latest
  • Swagger-UI version: 3.26.2
  • Swagger/OpenAPI version: OpenAPI 3.0.1
Describe the bug you're encountering

Swagger-UI is not displaying the schema if it's for a parameter from query, but it displays the description.

To reproduce...

Steps to reproduce the behavior:

  1. Load a yaml with a similar operation in Swagger-UI
    ...
    get:
      tags:
        - array query parameter test
      operationId: arrayQueryParamTest
      summary: Testing array in query parameter not rendered issue.
      parameters:
      - name: arrayTest
        in: query
        description: Array parameter in query
        schema:
          type: array
          items:
            type: string
            maxLength: 25
            description: Test item
            example: Example string item
      responses:
        200:
        ...
    
  2. Open the corresponding operation
  3. See that only parameter description is visible
Actual behavior

Only parameter description is shown without examples or schema

Expected behavior

I expected the schema to be shown in the parameter description.

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 loading the YAML reproduction in Swagger UI and trace the parameter-rendering path for an OpenAPI 3 query parameter. The fix is done when the parameter's schema, examples, and item details are rendered alongside its description.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.