swagger-editor icon indicating copy to clipboard operation
swagger-editor copied to clipboard

Client HTML2 doesn't have parameters' defaults

Open ybbih opened this issue 7 months ago • 0 comments

Q&A

  • OS: Ubuntu 22.04
  • Browser: Google Chrome
  • Version: 120.0.6099.224 (x64)
  • Method of installation: Online demo (https://editor.swagger.io/)
  • Swagger-Editor version: latest available on demo
  • Swagger/OpenAPI version: latest available on demo

Content & configuration

Example Swagger/OpenAPI definition:

components:
  parameters:
    limitParam:
      in: query
      name: limit
      required: false
      schema:
        type: integer
        minimum: 1
        maximum: 500
        default: 100
      description: The numbers of items to return.

Swagger-Editor configuration options: Default from https://editor.swagger.io/

Describe the bug you're encountering

When generating for client to HTML, default parameter value is shown but when choosing HTML2, default value is not visible.

HTML: image

HTML2: image

To reproduce...

Steps to reproduce the behavior:

  1. Go to https://editor.swagger.io/
  2. Create any route with query parameter and defined default value.
  3. Generate HTML2 for client
  4. See error

Expected behavior

HTML2 output includes default value next to parameter description.

ybbih avatar Jan 18 '24 08:01 ybbih