Bug Report Checklist
Description
If the basePath in the config is set to '' (empty string). The configuration is ignored and 'http://localhost' is used instead. That is unexpected behaviour.
Background
The basePath of the typescript-angular generated Files are currently set to 'http://localhost' (as a Fallback). When trying to setup the basePath to '' (empty String) the config is not used as the generated line of code configuration.basePath || basePath || this.basePath; is evaluated to false, because empty string in javascript is false.
protected basePath = 'http://localhost';
public configuration = new Configuration();
constructor(
protected httpClient: HttpClient,
@Optional() @Inject(BASE_PATH) basePath: string,
@Optional() configuration: Configuration
) {
if (configuration) {
this.configuration = configuration;
this.configuration.basePath = configuration.basePath || basePath || this.basePath;
} else {
this.configuration.basePath = basePath || this.basePath;
}
}
openapi-generator version
4.0.0-beta2
OpenAPI declaration file content or url
Command line used for generation
npm install @openapitools/[email protected]
openapi-generator generate -i swagger.json -g typescript-angular -o projects/client-api/src/lib/ --additional-properties="ngVersion=6.1.7" --additional-properties="supportsES6=true"
Steps to reproduce
- Generate typescript-angular package from openapi.config
- Configure the
ApiModule in app.module.ts
- Use a service from the generated typescript-angular package.
Related issues/PRs
Nothing found.
Suggest a fix
Two ways:
- Remove the fallback basePath by setting it to
'' (empty string)
- Fix the evalutation
basePath property.
Bug Report Checklist
Description
If the
basePathin the config is set to''(empty string). The configuration is ignored and'http://localhost'is used instead. That is unexpected behaviour.Background
The basePath of the typescript-angular generated Files are currently set to
'http://localhost'(as a Fallback). When trying to setup the basePath to''(empty String) the config is not used as the generated line of codeconfiguration.basePath || basePath || this.basePath;is evaluated to false, because empty string in javascript is false.openapi-generator version
4.0.0-beta2
OpenAPI declaration file content or url
Command line used for generation
Steps to reproduce
ApiModulein app.module.tsRelated issues/PRs
Nothing found.
Suggest a fix
Two ways:
''(empty string)basePathproperty.