makes basePath optional

This commit is contained in:
LeFnord 2016-09-06 10:52:31 +02:00
parent 28fb22827f
commit 719dfbfa13
2 changed files with 2 additions and 2 deletions

View File

@ -56,7 +56,8 @@ export class SpecManager {
}
let host = this._schema.host || urlParts.host;
this.apiUrl = protocol + '://' + host + this._schema.basePath;
let basePath = this._schema.basePath || '/';
this.apiUrl = protocol + '://' + host + basePath;
if (this.apiUrl.endsWith('/')) {
this.apiUrl = this.apiUrl.substr(0, this.apiUrl.length - 1);
}

View File

@ -14,7 +14,6 @@
}
},
"host": "petstore.swagger.io",
"basePath": "/v2/",
"schemes": ["http"],
"paths": {
"/pet": {