Skip to content

Only first path parameter is replaced in "Try it out" #9928

@afdaniele

Description

@afdaniele

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:

  1. Point an instance of swagger-ui (default configuration and options) to the OpenAPI description above;
  2. Click on 'Try it out' for the only endpoint defined;
  3. Populate the 4 parameter values;
  4. Click on "Execute"
  5. 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

image

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions