From 22c7a9672cd998dc90fedaf9bccfa841cb6c0e77 Mon Sep 17 00:00:00 2001 From: Tony Tam Date: Thu, 30 Oct 2014 07:59:02 -0700 Subject: [PATCH] updated from swagger-js --- lib/swagger.js | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/lib/swagger.js b/lib/swagger.js index 73c6ba32..6382a5d1 100644 --- a/lib/swagger.js +++ b/lib/swagger.js @@ -498,7 +498,7 @@ } } o.nickname = this.sanitize(o.nickname); - var op = new SwaggerOperation(o.nickname, resource_path, method, o.parameters, o.summary, o.notes, type, responseMessages, this, consumes, produces, o.authorizations); + var op = new SwaggerOperation(o.nickname, resource_path, method, o.parameters, o.summary, o.notes, type, responseMessages, this, consumes, produces, o.authorizations, o.deprecated); this.operations[op.nickname] = op; output.push(this.operationsArray.push(op)); } @@ -691,7 +691,7 @@ return str; }; - var SwaggerOperation = function (nickname, path, method, parameters, summary, notes, type, responseMessages, resource, consumes, produces, authorizations) { + var SwaggerOperation = function (nickname, path, method, parameters, summary, notes, type, responseMessages, resource, consumes, produces, authorizations, deprecated) { var _this = this; var errors = []; @@ -707,6 +707,7 @@ this.consumes = consumes; this.produces = produces; this.authorizations = authorizations; + this.deprecated = deprecated; this["do"] = __bind(this["do"], this); if (errors.length > 0) { @@ -738,7 +739,7 @@ } param.type = type; - if (type.toLowerCase() === 'boolean') { + if (type && type.toLowerCase() === 'boolean') { param.allowableValues = {}; param.allowableValues.values = ["true", "false"]; } @@ -975,22 +976,9 @@ var param = params[i]; if (param.paramType === 'query') { if (args[param.name] !== undefined) { - var value = args[param.name]; if (queryParams !== '') - queryParams += '&'; - if (Array.isArray(value)) { - var j; - var output = ''; - for(j = 0; j < value.length; j++) { - if(j > 0) - output += ','; - output += encodeURIComponent(value[j]); - } - queryParams += encodeURIComponent(param.name) + '=' + output; - } - else { - queryParams += encodeURIComponent(param.name) + '=' + encodeURIComponent(args[param.name]); - } + queryParams += "&"; + queryParams += encodeURIComponent(param.name) + '=' + encodeURIComponent(args[param.name]); } } }