Skip to content

Display enums in parameter info #3873

Closed
@hkosova

Description

@hkosova
Q A
Bug or feature request? Feature request
Which Swagger/OpenAPI version? 2.0, 3.0
Which Swagger-UI version? 3.4.3
How did you install Swagger-UI? http://editor.swagger.io
Which browser & version? N/A
Which operating system? N/A

Demonstration API definition

2.0:

swagger: '2.0'
info:
  title: test
  version: 0.0.0
paths:
  /report:
    get:
      parameters:
        - in: query
          name: rel_date
          required: true
          type: string
          enum:
            - today
            - yesterday
            - lastweek
      responses:
        200:
          description: OK

3.0:

openapi: 3.0.0
info:
  title: test
  version: 0.0.0
paths:
  /report:
    get:
      parameters:
        - in: query
          name: rel_date
          required: true
          schema:
            type: string
            enum:
              - today
              - yesterday
              - lastweek
      responses:
        '200':
          description: OK

Expected Behavior

The parameter info in the UI displays the enum values.

Current Behavior

The enum values are only displayed when we do "try it out" and are not displayed normally.

Parameter enum values

Context

Related to #3518.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions