Browse Source

updated from swagger-js

bubble
Tony Tam 10 years ago
parent
commit
22c7a9672c
1 changed files with 6 additions and 18 deletions
  1. +6
    -18
      lib/swagger.js

+ 6
- 18
lib/swagger.js View File

@@ -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]);
}
}
}


Loading…
Cancel
Save