Open
Description
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
- Open the Swagger online system.
- Create a new copy of the PetStore example and edit it. Ensure that the Editor, Nav, and UI Docs are visible.
- Edit the definition of
GET /pet/findByStatus
. - 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:
- https://petstore.swagger.io/v2/pet/findByStatus?status=available
- https://petstore.swagger.io/v2/pet/findByStatus?status=available&userParam=creator
- https://petstore.swagger.io/v2/pet/findByStatus?status=available&userParam=creator&userParam=lastUpdatedBy
The following URIs are not valid.
- https://petstore.swagger.io/v2/pet/findByStatus?status=available&userParam=
- https://petstore.swagger.io/v2/pet/findByStatus?status=available&userParam=&userParam=creator
- https://petstore.swagger.io/v2/pet/findByStatus?status=available&userParam=&userParam=creator&userParam=lastUpdatedBy
Swagger-UI configuration options:
N/A
Describe the bug you're encountering
To reproduce...
Steps to reproduce the behavior:
- Open the Swagger online system.
- Create a new copy of the PetStore example and edit it. Ensure that the Editor, Nav, and UI Docs panes are visible.
- Edit the definition of
GET /pet/findByStatus
. - Add the query parameter specified in Content & Configuration to the
parameters
attribute ofGET /pet/findByStatus
- In the UI Docs pane, expand GET
pet/findByStatus
. - Look at the options available for userParam.
- One of the available options is --.
- Click Try it out.
- Select status available and userParam --, then click Execute.
- 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=
.