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

Even if 'Try it out' is not clicked enum string values are enabled #5568

Closed
leseb83 opened this issue Aug 26, 2019 · 3 comments · Fixed by #5601
Closed

Even if 'Try it out' is not clicked enum string values are enabled #5568

leseb83 opened this issue Aug 26, 2019 · 3 comments · Fixed by #5601

Comments

@leseb83
Copy link

leseb83 commented Aug 26, 2019

Q&A (please complete the following information)

  • OS: Windows
  • Browser: Chrome
  • Version: latest
  • Method of installation: dist assets
  • Swagger-UI version: 3.23.6
  • Swagger/OpenAPI version: OpenAPI 3.0

Content & configuration

We have the following configuration for the 'sort' parameter:

in: query
name: sort
description: 'Desc'
schema:
    type: string
     default: name
     enum: [name,createDate,updateDate]

image

All other entries but enum string are disabled as expected.

Describe the bug you're encountering

Until you press the "Try it out' all fields are supposed to be disabled.

To reproduce...

See above

@shockey
Copy link
Contributor

shockey commented Aug 26, 2019

Interesting.

@leseb83, can you provide a full OpenAPI document we can use to reproduce this?

@leseb83
Copy link
Author

leseb83 commented Aug 27, 2019

@shockey, hi, here is a sample.

{
  "openapi": "3.0.1",
  "info": {
    "title": "Test API",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "/api/1"
    }
  ],
  "paths": {
    "/fooservice": {
      "get": {
        "summary": "Get Web service",
        "parameters": [
          {
            "in": "query",
            "name": "sort",
            "description": "Desc",
            "required": false,
            "schema": {
              "type": "string",
              "default": "name",
              "enum": [
                "name",
                "createDate",
                "updateDate"
              ]
            }
          },
          {
            "in": "query",
            "name": "asc",
            "description": "Desc 2",
            "required": false,
            "schema": {
              "type": "boolean",
              "default": true
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The service has been called with success.",
            "content": {
              "application/json": {}
            }
          },
          "400": {
            "description": "Invalid data provided."
          }
        }
      }
    }
  },
  "security": [
    {
      "basicAuth": []
    }
  ]
}

@shockey
Copy link
Contributor

shockey commented Sep 11, 2019

Fixed! 😄

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

Successfully merging a pull request may close this issue.

2 participants