Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Array type in query param #2890

Closed
wwatroba opened this issue Apr 10, 2017 · 7 comments
Closed

Array type in query param #2890

wwatroba opened this issue Apr 10, 2017 · 7 comments

Comments

@wwatroba
Copy link

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"}

@webron
Copy link
Contributor

webron commented Apr 10, 2017

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

@wwatroba
Copy link
Author

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)

@webron
Copy link
Contributor

webron commented Apr 10, 2017

Can you share a spec that reproduces the issue?

@wwatroba
Copy link
Author

{
  "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"
      }
    }
  }
}

@webron
Copy link
Contributor

webron commented Apr 12, 2017

Thanks, issue confirmed.

@aalleexxeeii
Copy link

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

@webron
Copy link
Contributor

webron commented Apr 23, 2017

It's deployed now.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants