updated oauth2 support into a single config
This commit is contained in:
19
dist/lib/swagger.js
vendored
19
dist/lib/swagger.js
vendored
@@ -1,5 +1,5 @@
|
||||
// swagger.js
|
||||
// version 2.0.26
|
||||
// version 2.0.27
|
||||
|
||||
var __bind = function(fn, me){
|
||||
return function(){
|
||||
@@ -882,6 +882,21 @@ SwaggerOperation.prototype.pathXml = function() {
|
||||
return this.path.replace("{format}", "xml");
|
||||
};
|
||||
|
||||
SwaggerOperation.prototype.encodePathParam = function(pathParam) {
|
||||
var encParts, part, parts, _i, _len;
|
||||
if (pathParam.indexOf("/") === -1) {
|
||||
return encodeURIComponent(pathParam);
|
||||
} else {
|
||||
parts = pathParam.split("/");
|
||||
encParts = [];
|
||||
for (_i = 0, _len = parts.length; _i < _len; _i++) {
|
||||
part = parts[_i];
|
||||
encParts.push(encodeURIComponent(part));
|
||||
}
|
||||
return encParts.join("/");
|
||||
}
|
||||
};
|
||||
|
||||
SwaggerOperation.prototype.urlify = function(args) {
|
||||
var url = this.resource.basePath + this.pathJson();
|
||||
var params = this.parameters;
|
||||
@@ -891,7 +906,7 @@ SwaggerOperation.prototype.urlify = function(args) {
|
||||
if(args[param.name]) {
|
||||
// apply path params and remove from args
|
||||
var reg = new RegExp('\{' + param.name + '[^\}]*\}', 'gi');
|
||||
url = url.replace(reg, encodeURIComponent(args[param.name]));
|
||||
url = url.replace(reg, this.encodePathParam(args[param.name]));
|
||||
delete args[param.name];
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user