Only first path parameter is replaced in "Try it out"
Q&A (please complete the following information)
- OS: Linux (Ubuntu 22.04)
- Browser: Chrome
- Version: 124.0
- Method of installation: dist assets
- Swagger-UI version: 5.17.7
- Swagger/OpenAPI version: OpenAPI 3.0
Content & configuration
Example Swagger/OpenAPI definition:
{
"openapi": "3.0.3",
"info": {
"title": "My API",
"version": "1.0",
"description": "My API description"
},
"paths": {
"/api/v1/docker/image/metadata/{registry}/{organization}/{repository}/{tag}/latest/": {
"get": {
"operationId": "docker/image/metadata/latest",
"description": "Get the latest metadata of a docker image",
"summary": "Get latest Image Metadata",
"parameters": [
{
"in": "path",
"name": "registry",
"schema": {
"type": "string"
},
"required": true
},
{
"in": "path",
"name": "organization",
"schema": {
"type": "string"
},
"required": true
},
{
"in": "path",
"name": "repository",
"schema": {
"type": "string"
},
"required": true
},
{
"in": "path",
"name": "tag",
"schema": {
"type": "string"
},
"required": true
}
],
"tags": [
"Docker"
],
"responses": {
"200": {
"description": "No response body"
}
}
}
}
}
}
Describe the bug you're encountering
The path defines 4 parameters, when the API endpoint is tested using the "Try it out" button, only the first parameter is replaced, the others are left as placeholders (see image below).
To reproduce...
Steps to reproduce the behavior:
- Point an instance of swagger-ui (default configuration and options) to the OpenAPI description above;
- Click on 'Try it out' for the only endpoint defined;
- Populate the
4parameter values; - Click on "Execute"
- See how only the first parameter is replaced with the given value;
Expected behavior
All parameters should be replaced in the endpoint's path.
Screenshots
I can confirm I am seeing this and rolling back to 5.17.6 restores it to working correctly.
@dfad1469 Thanks. I confirm that the problem is not present in v5.17.6.
Addressed in https://github.com/swagger-api/swagger-ui/pull/9927 with a swagger-client change: https://github.com/swagger-api/swagger-js/pull/3511
Released in https://github.com/swagger-api/swagger-ui/releases/tag/v5.17.8