Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When choose the "--" item for enum array, the parameter is sent with empty value. #5971

Closed
tedyu002 opened this issue Apr 22, 2020 · 1 comment

Comments

@tedyu002
Copy link

#5095 # Q&A (please complete the following information)

  • OS: Windows 10
  • Browser: chrome
  • Version: 80.0.3987.163
  • Method of installation: dist assets
  • Swagger-UI version: 3.25.0
  • Swagger/OpenAPI version: OpenAPI 3.0.2

Content & configuration

Example Swagger/OpenAPI definition:

openapi: 3.0.2
info:
  title: API
  description: API
  version: '0.1'
paths:
  /function:
    get:
      parameters:
        - description: items
          required: false
          schema:
            title: item
            type: array
            items:
              enum:
                - first_item
                - second_item
              type: string
            description: item
          name: item
          in: query
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: string

Swagger-UI configuration options:

    const ui = SwaggerUIBundle({
        url: '/openapi.json',
    oauth2RedirectUrl: window.location.origin + '/docs/oauth2-redirect',
        dom_id: '#swagger-ui',
        presets: [
        SwaggerUIBundle.presets.apis,
        SwaggerUIBundle.SwaggerUIStandalonePreset
        ],
        layout: "BaseLayout",
        deepLinking: true
    })
?yourQueryStringConfig

Describe the bug you're encountering

When choose "--" of the multiple-select box (produced by enum Array).
The parameter should not be in the query string, but "item=" is in the query string.

To reproduce...

Steps to reproduce the behavior:

  1. Go to /function
  2. Click on "--" in the item parameter
  3. Execute
  4. See error

Expected behavior

no item in the query string.

Screenshots

editor swagger io_

Additional context or thoughts

@hkosova
Copy link
Contributor

hkosova commented Apr 22, 2020

Duplicate of #5176.

@hkosova hkosova closed this as completed Apr 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants