swagger-ui
swagger-ui copied to clipboard
Even if 'Try it out' is not clicked enum string values are enabled
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]

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
Interesting.
@leseb83, can you provide a full OpenAPI document we can use to reproduce this?
@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": []
}
]
}
Fixed! 😄