swagger-ui icon indicating copy to clipboard operation
swagger-ui copied to clipboard

Two url parameters are not separated with &

Open sosoxuc opened this issue 12 years ago • 2 comments

Two url parameters are not separated with &

    "/security/authUser": {
        "get": {
            "summary": "User auth",
            "description": "Auth API",
            "parameters": [
                {
                    "name": "username",
                    "in": "query",
                    "description": "Username.",
                    "required": true,
                    "type": "string"
                },
                {
                    "name": "password",
                    "in": "query",
                    "description": "Password.",
                    "required": true,
                    "type": "string"
                }
            ],
            "tags": [
                "Security"
            ],
            "responses": {
                "200": {
                    "description": "String representing auth satus",
                    "schema": {
                        "type": "string"
                    }
                }
            }
        }
    }

produces : http://localhost:8080/restapi/security/authUser?username=1password=2

when i write 1 and 2 as values and press "Try it out!"

sosoxuc avatar Sep 21 '14 22:09 sosoxuc

I see this too. I think when building up the query parameter you could add in the delimiter:

       else if (param.in === 'query') {
-        if(querystring === '')
-          querystring += '?';
+        if(querystring === ''){
+            querystring += '?';
+        } else {
+            querystring += '&';
+        }

watnotte avatar Sep 22 '14 17:09 watnotte

thanks, pushed

fehguy avatar Sep 23 '14 04:09 fehguy