Bug Report Checklist
Description
the same issue with #2731
openapi-generator version
latest version
Steps to reproduce
new DefaultApi(
new Configuration({
basePath: "",
}),
)
the basePath will replaced by "localhost/xxxx", but i expect it as /xxxx
Related issues/PRs
#2731
Suggest a fix
it caused by this line:
|
return this.configuration.basePath || BASE_PATH; |
the code above assume that this.configuration.basePath not a empty string, otherwise it will be replaced by BASE_PATH.
use the below code to fix it:
return this.configuration.basePath != null ? this.configuration.basePath : BASE_PATH;
it means if this.configuration.basePath NOT A NULL OR UNDEFINED, then use it, otherwise use the BASE_PATH
Bug Report Checklist
Description
the same issue with #2731
openapi-generator version
latest version
Steps to reproduce
the basePath will replaced by "localhost/xxxx", but i expect it as /xxxx
Related issues/PRs
#2731
Suggest a fix
it caused by this line:
openapi-generator/modules/openapi-generator/src/main/resources/typescript-fetch/runtime.mustache
Line 125 in baf0e85
the code above assume that this.configuration.basePath not a empty string, otherwise it will be replaced by BASE_PATH.
use the below code to fix it:
it means if this.configuration.basePath NOT A NULL OR UNDEFINED, then use it, otherwise use the BASE_PATH