Swagger-codegen: Typescript-angular2 - Allow empty basePath as OpaqueToken

Created on 16 Jul 2017  路  4Comments  路  Source: swagger-api/swagger-codegen

Description

Under https://github.com/swagger-api/swagger-codegen/blob/ba704e3ac8635d2c35d87fbfb3e0243cf6f35da8/modules/swagger-codegen/src/main/resources/typescript-angular2/api.mustache

the basePath check doesn't allow to have an empty string so it ill be set to the default value of basePath

Instead of

if (basePath) {
    this.basePath = basePath;
}

it should be:

if (basePath !== null) {
    this.basePath = basePath;
}
Swagger-codegen version

latest

Swagger declaration file content or url
Command line used for generation
Steps to reproduce
Related issues/PRs
Suggest a fix/enhancement
TypeScript

Most helpful comment

@wing328 Can i do something more to get this done?

All 4 comments

@PG2000 thanks for reporting the issue. Please file a PR with updated Petstore sample so that we can review the fix more easily.

@wing328: I've updated the Petstore example

@wing328 Can i do something more to get this done?

In case this helps someone else, I just faced the same issue, and a workaround is assigning basePath injected variable to ' ' (mind the whitespace).

Was this page helpful?
0 / 5 - 0 ratings