Skip to content

Commit

Permalink
fix for #735
Browse files Browse the repository at this point in the history
  • Loading branch information
fehguy committed Dec 3, 2014
1 parent 5b39729 commit 86eef06
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 10 deletions.
19 changes: 14 additions & 5 deletions dist/lib/swagger-client.js
Expand Up @@ -513,7 +513,11 @@ SwaggerClient.prototype.idFromOp = function(path, httpMethod, op) {
return (op.operationId);
}
else {
return path.substring(1).replace(/\//g, "_").replace(/\{/g, "").replace(/\}/g, "") + "_" + httpMethod;
return path.substring(1)
.replace(/\//g, "_")
.replace(/\{/g, "")
.replace(/\}/g, "")
.replace(/\./g, "_") + "_" + httpMethod;
}
}

Expand Down Expand Up @@ -658,8 +662,8 @@ Operation.prototype.getType = function (param) {
str = 'integer';
else if(type === 'integer' && format === 'int64')
str = 'long';
else if(type === 'integer' && typeof format === 'undefined')
str = 'long';
else if(type === 'integer')
str = 'integer'
else if(type === 'string' && format === 'date-time')
str = 'date-time';
else if(type === 'string' && format === 'date')
Expand All @@ -668,7 +672,7 @@ Operation.prototype.getType = function (param) {
str = 'float';
else if(type === 'number' && format === 'double')
str = 'double';
else if(type === 'number' && typeof format === 'undefined')
else if(type === 'number')
str = 'double';
else if(type === 'boolean')
str = 'boolean';
Expand Down Expand Up @@ -878,7 +882,12 @@ Operation.prototype.execute = function(arg1, arg2, arg3, arg4, parent) {
// todo append?
args.body = encoded;
}
var url = this.scheme + '://' + this.host + this.basePath + requestUrl + querystring;
var url = this.scheme + '://' + this.host;

if(this.basePath !== '/')
url += this.basePath;

url += requestUrl + querystring;

var obj = {
url: url,
Expand Down
19 changes: 14 additions & 5 deletions lib/swagger-client.js
Expand Up @@ -513,7 +513,11 @@ SwaggerClient.prototype.idFromOp = function(path, httpMethod, op) {
return (op.operationId);
}
else {
return path.substring(1).replace(/\//g, "_").replace(/\{/g, "").replace(/\}/g, "") + "_" + httpMethod;
return path.substring(1)
.replace(/\//g, "_")
.replace(/\{/g, "")
.replace(/\}/g, "")
.replace(/\./g, "_") + "_" + httpMethod;
}
}

Expand Down Expand Up @@ -658,8 +662,8 @@ Operation.prototype.getType = function (param) {
str = 'integer';
else if(type === 'integer' && format === 'int64')
str = 'long';
else if(type === 'integer' && typeof format === 'undefined')
str = 'long';
else if(type === 'integer')
str = 'integer'
else if(type === 'string' && format === 'date-time')
str = 'date-time';
else if(type === 'string' && format === 'date')
Expand All @@ -668,7 +672,7 @@ Operation.prototype.getType = function (param) {
str = 'float';
else if(type === 'number' && format === 'double')
str = 'double';
else if(type === 'number' && typeof format === 'undefined')
else if(type === 'number')
str = 'double';
else if(type === 'boolean')
str = 'boolean';
Expand Down Expand Up @@ -878,7 +882,12 @@ Operation.prototype.execute = function(arg1, arg2, arg3, arg4, parent) {
// todo append?
args.body = encoded;
}
var url = this.scheme + '://' + this.host + this.basePath + requestUrl + querystring;
var url = this.scheme + '://' + this.host;

if(this.basePath !== '/')
url += this.basePath;

url += requestUrl + querystring;

var obj = {
url: url,
Expand Down

0 comments on commit 86eef06

Please sign in to comment.