Skip to content

Missing parameter fields when defined in Path Item Object #4456

@blortfish

Description

@blortfish

When defining multiple parameters in a PathItemObject, only the first input field is showing after clicking Try it out. This problem appears to have been introduced around 3.11.0 (works as expected in 3.10.0).

Q A
Bug or feature request? bug
Which Swagger/OpenAPI version? 2.0
Which Swagger-UI version? 3.11.0+
How did you install Swagger-UI? yarn
Which browser & version? Chrome 65.0.3325.181
Which operating system? Mac os 10.13.4

Demonstration API definition

{
  "swagger": "2.0",
  "info": {
    "description": "This is a sample server Petstore server.  You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/).  For this sample, you can use the api key `special-key` to test the authorization filters.",
    "version": "1.0.0",
    "title": "Swagger Petstore",
    "termsOfService": "http://swagger.io/terms/",
    "contact": {
      "email": "apiteam@swagger.io"
    },
    "license": {
      "name": "Apache 2.0",
      "url": "http://www.apache.org/licenses/LICENSE-2.0.html"
    }
  },
  "host": "petstore.swagger.io",
  "basePath": "/v2",
  "tags": [
    {
      "name": "pet",
      "description": "Everything about your Pets",
      "externalDocs": {
        "description": "Find out more",
        "url": "http://swagger.io"
      }
    }
  ],
  "schemes": [
    "http"
  ],
  "paths": {
    "/pet/{something}/{anotherthing}/{yetanotherthing}": {
      "parameters": [
        {
          "$ref": "#/parameters/something"
        },
        {
          "$ref": "#/parameters/anotherthing"
        },
        {
          "$ref": "#/parameters/yetanotherthing"
        }
      ],
      "post": {
        "tags": [
          "pet"
        ],
        "summary": "Add a new pet to the store",
        "description": "",
        "operationId": "addPet",
        "consumes": [
          "application/json",
          "application/xml"
        ],
        "parameters": [{
          "name": "Pet",
          "in": "body",
          "required": true,
          "schema": {
            "$ref": "#/definitions/Pet"
          }
        }],
        "produces": [
          "application/xml",
          "application/json"
        ],
        "responses": {
          "405": {
            "description": "Invalid input"
          }
        },
        "security": [
          {
            "petstore_auth": [
              "write:pets",
              "read:pets"
            ]
          }
        ]
      }
    }
  },
  "securityDefinitions": {
    "petstore_auth": {
      "type": "oauth2",
      "authorizationUrl": "http://petstore.swagger.io/oauth/dialog",
      "flow": "implicit",
      "scopes": {
        "write:pets": "modify pets in your account",
        "read:pets": "read your pets"
      }
    },
    "api_key": {
      "type": "apiKey",
      "name": "api_key",
      "in": "header"
    }
  },
  "definitions": {
    "Category": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer",
          "format": "int64"
        },
        "name": {
          "type": "string"
        }
      },
      "xml": {
        "name": "Category"
      }
    },
    "Tag": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer",
          "format": "int64"
        },
        "name": {
          "type": "string"
        }
      },
      "xml": {
        "name": "Tag"
      }
    },
    "Pet": {
      "type": "object",
      "required": [
        "name",
        "photoUrls"
      ],
      "properties": {
        "id": {
          "type": "integer",
          "format": "int64"
        },
        "category": {
          "$ref": "#/definitions/Category"
        },
        "name": {
          "type": "string",
          "example": "doggie"
        },
        "photoUrls": {
          "type": "array",
          "xml": {
            "name": "photoUrl",
            "wrapped": true
          },
          "items": {
            "type": "string"
          }
        },
        "tags": {
          "type": "array",
          "xml": {
            "name": "tag",
            "wrapped": true
          },
          "items": {
            "$ref": "#/definitions/Tag"
          }
        },
        "status": {
          "type": "string",
          "description": "pet status in the store",
          "enum": [
            "available",
            "pending",
            "sold"
          ]
        }
      },
      "xml": {
        "name": "Pet"
      }
    }
  },
  "parameters": {
    "something": {
      "name": "something",
      "in": "path",
      "description": "a thing",
      "required": true,
      "type": "string"
    },
    "anotherthing": {
      "name": "anotherthing",
      "in": "path",
      "description": "another thing",
      "required": true,
      "type": "string"
    },
    "yetanotherthing": {
      "name": "yetanotherthing",
      "in": "path",
      "description": "yet another thing",
      "required": true,
      "type": "string"
    }
  },
  "externalDocs": {
    "description": "Find out more about Swagger",
    "url": "http://swagger.io"
  }
}

Easiest to reproduce at http://petstore.swagger.io/ with https://hastebin.com/raw/evewuxahex

Expected Behavior

3.10.0
screen shot 2018-04-19 at 10 04 23 am

Current Behavior

3.11.0 +
screen shot 2018-04-19 at 10 08 42 am

Context

Swagger-ui upgrade

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions