mirror of
https://github.com/Redocly/redoc.git
synced 2024-11-23 00:56:33 +03:00
makes basePath optional
This commit is contained in:
parent
28fb22827f
commit
719dfbfa13
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -14,7 +14,6 @@
|
|||
}
|
||||
},
|
||||
"host": "petstore.swagger.io",
|
||||
"basePath": "/v2/",
|
||||
"schemes": ["http"],
|
||||
"paths": {
|
||||
"/pet": {
|
||||
|
|
Loading…
Reference in New Issue
Block a user