Skip to content

In Swagger Editor, UI Docs pane display for header parameters is incorrect #7741

Open
@jmalin-splunk

Description

@jmalin-splunk

Q&A (please complete the following information)

  • OS: [macOS Big Sur 11.6.2]
  • Browser: [Chrome Version 97.0.4692.71]
  • Version: [Online editor]
  • Method of installation: [cloud-based]
  • Swagger-UI version: [most current]
  • Swagger/OpenAPI version: [OpenAPI 3.0]

Content & configuration

  1. Open the Swagger online system.
  2. Create a new copy of the PetStore example and edit it. Ensure that the Editor, Nav, and UI Docs are visible.
  3. Edit the definition of GET /pet/findByStatus.
  4. Add the following query parameter definition to the parameters section. This definition is supposed to describe an optional query parameter that, if used, expands into one or two query entries encoded on the URI:
        - name: userParam
          in: query
          description: Test multiple occurrence of parameter
          required: false
          explode: true
          schema:
            type: array
            items:
              type: string
              enum:
              - creator
              - lastUpdatedBy
            uniqueItems: true

If you set the query parameter status to available the following URIs are valid:

The following URIs are not valid.

Swagger-UI configuration options:
N/A

Describe the bug you're encountering

To reproduce...

Steps to reproduce the behavior:

  1. Open the Swagger online system.
  2. Create a new copy of the PetStore example and edit it. Ensure that the Editor, Nav, and UI Docs panes are visible.
  3. Edit the definition of GET /pet/findByStatus.
  4. Add the query parameter specified in Content & Configuration to the parameters attribute of GET /pet/findByStatus
  5. In the UI Docs pane, expand GET pet/findByStatus.
  6. Look at the options available for userParam.
  7. One of the available options is --.
  8. Click Try it out.
  9. Select status available and userParam --, then click Execute.
  10. The cURL (bash) tab displays the following URI: https://petstore.swagger.io/v2/pet/findByStatus?status=available&userParam=. This is an invalid URI.

Expected behavior

Swagger Editor should not display the -- option in the list of options for userParam. There should be no way to create the URI https://petstore.swagger.io/v2/pet/findByStatus?status=available&userParam=.

Screenshots

Additional context or thoughts

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions