swagger-api / swagger-ui

Swagger UI is a collection of HTML, JavaScript, and CSS assets that dynamically generate beautiful documentation from a Swagger-compliant API.
https://swagger.io
Apache License 2.0
26.63k stars 8.96k forks source link

Array of (string) enum query parameters are rendered as strings #10211

Open JMLX42 opened 2 weeks ago

JMLX42 commented 2 weeks ago

Q&A (please complete the following information)

Content & configuration

Example Swagger/OpenAPI definition:

openapi: 3.1.0
info:
  title: Swagger Petstore - OpenAPI 3.1
servers:
  - url: https://petstore3.swagger.io/api/v3
paths:
  /pet/findByStatus:
    get:
      tags:
        - pet
      summary: Finds Pets by status
      description: Multiple status values can be provided with comma separated strings
      operationId: findPetsByStatus
      parameters:
        - name: status
          in: query
          description: Status values that need to be considered for filter
          required: false
          explode: true
          schema:
            type:
              - "array"
            items:
              type: "string"
              enum:
                - available
                - pending
                - sold

Describe the bug you're encountering

status is a free text input

image

To reproduce...

  1. Go to https://editor-next.swagger.io/
  2. Edit the schema of the status parameter as documented above
  3. Scroll down to 'GET /pet/findByStatus'

Expected behavior

image