swagger-api / swagger-api/swagger-ui

Swagger UI does not display minimum / exclusiveMinimum constraints for path and query parameters

Open
#10,562 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

type: enhancement version: 5.x
Dominant language
JavaScript
Stars
29k
Forks
9.3k
Avg merge
2d 23h
Merged PRs (30d)
25

Description

When defining path or query parameter schemas in OpenAPI with constraints such as minimum and exclusiveMinimum, Swagger UI does not render these constraints in the parameter documentation. However, the same parameter validation rules are displayed for request body.

This makes it unclear to API consumers what numeric boundaries are enforced, unless mentioned somewhere else.

/v1/pet/{id}:
  parameters:
    - name: id
      in: path
      required: true
      description: ID.
      schema:
        type: integer
        minimum: 0
        exclusiveMinimum: true

Expected Behavior:

Swagger UI should display constraints (minimum, maximum, exclusiveMinimum, exclusiveMaximum) for parameters in the rendered documentation.

For example, users should see that id must be integer greater than or equal to 0.

Image

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 OpenAPI path and query parameter example in Swagger UI and trace the parameter documentation rendering entry point. Verify how request-body constraints are displayed, then ensure minimum, maximum, exclusiveMinimum, and exclusiveMaximum appear for rendered parameters and confirm the example shows the expected numeric boundary.

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.