Swagger-ui: Array type in query param

Created on 10 Apr 2017  路  7Comments  路  Source: swagger-api/swagger-ui

There is a problem with rendering textarea for input multiple params.
With 2.2.6 it was working.

zrzut ekranu z 2017-04-10 11-41-13

Parameter definition:
{"name":"name","in":"query","required":true,"type":"array","items":{"type":"string"},"collectionFormat":"multi"}

P1 lock-bot bug 3.x

Most helpful comment

{
  "swagger":"2.0",
  "basePath":"/v1",
  "paths":{
    "/test":{
      "get":{
        "summary":"Lists",
        "description":"",
        "operationId":"getIds",
        "produces":[
          "application/json"
        ],
        "parameters":[
          {
            "name":"name",
            "in":"query",
            "required":true,
            "type":"array",
            "items":{
              "type":"string"
            },
            "collectionFormat":"multi"
          }
        ],
        "responses":{
          "200":{
            "description":"successful operation",
            "schema":{
              "$ref":"#/definitions/GetResponse"
            }
          }
        },
        "security":[
          {
            "apiKey":[

            ]
          }
        ]
      }
    }
  },
  "securityDefinitions":{
    "apiKey":{
      "description":"",
      "type":"apiKey",
      "name":"apiKey",
      "in":"query"
    }
  },
  "definitions":{
    "GetResponse":{
      "type":"object",
      "properties":{
        "name":{
          "type":"string"
        }
      },
      "xml":{
        "name":"GetResponse"
      }
    }
  }
}

All 7 comments

There's no text area rendering. It's just a list of items that you can add and remove.

After clicking on "Add item" i get "馃槺 Could not render t, see the console."
Console:

TypeError: h.filter is not a function
    at swagger-ui-bundle.js:94121
    at swagger-ui-bundle.js:9717
    at ze.__iterate (swagger-ui-bundle.js:10952)
    at r.__iterateUncached (swagger-ui-bundle.js:9717)
    at W (swagger-ui-bundle.js:9717)
    at r.M.__iterate (swagger-ui-bundle.js:9717)
    at r.toArray (swagger-ui-bundle.js:10952)
    at new ze (swagger-ui-bundle.js:9717)
    at St (swagger-ui-bundle.js:9717)
    at ze.map (swagger-ui-bundle.js:10952)

Can you share a spec that reproduces the issue?

{
  "swagger":"2.0",
  "basePath":"/v1",
  "paths":{
    "/test":{
      "get":{
        "summary":"Lists",
        "description":"",
        "operationId":"getIds",
        "produces":[
          "application/json"
        ],
        "parameters":[
          {
            "name":"name",
            "in":"query",
            "required":true,
            "type":"array",
            "items":{
              "type":"string"
            },
            "collectionFormat":"multi"
          }
        ],
        "responses":{
          "200":{
            "description":"successful operation",
            "schema":{
              "$ref":"#/definitions/GetResponse"
            }
          }
        },
        "security":[
          {
            "apiKey":[

            ]
          }
        ]
      }
    }
  },
  "securityDefinitions":{
    "apiKey":{
      "description":"",
      "type":"apiKey",
      "name":"apiKey",
      "in":"query"
    }
  },
  "definitions":{
    "GetResponse":{
      "type":"object",
      "properties":{
        "name":{
          "type":"string"
        }
      },
      "xml":{
        "name":"GetResponse"
      }
    }
  }
}

Thanks, issue confirmed.

When is it planned to deploy the fix to http://petstore.swagger.io/ ?

It's deployed now.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

azamatsulaiman picture azamatsulaiman  路  34Comments

bebraw picture bebraw  路  32Comments

replaysMike picture replaysMike  路  120Comments

grosch picture grosch  路  75Comments

valdemon picture valdemon  路  37Comments