From 5a5c3db938a1aa8dd0d3f51cee79807bedc062cb Mon Sep 17 00:00:00 2001 From: duxiaofeng Date: Thu, 13 Feb 2020 23:36:48 +0800 Subject: [PATCH] fix #5282: Base Path can't be set to '' (#5305) Co-authored-by: Esteban Gehring --- .../src/main/resources/typescript-fetch/runtime.mustache | 2 +- .../client/petstore/typescript-fetch/builds/default/runtime.ts | 2 +- .../petstore/typescript-fetch/builds/es6-target/src/runtime.ts | 2 +- .../typescript-fetch/builds/multiple-parameters/runtime.ts | 2 +- .../builds/prefix-parameter-interfaces/src/runtime.ts | 2 +- .../builds/typescript-three-plus/src/runtime.ts | 2 +- .../petstore/typescript-fetch/builds/with-interfaces/runtime.ts | 2 +- .../typescript-fetch/builds/with-npm-version/src/runtime.ts | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/typescript-fetch/runtime.mustache b/modules/openapi-generator/src/main/resources/typescript-fetch/runtime.mustache index 29957247033..68a3811bb39 100644 --- a/modules/openapi-generator/src/main/resources/typescript-fetch/runtime.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-fetch/runtime.mustache @@ -133,7 +133,7 @@ export class Configuration { constructor(private configuration: ConfigurationParameters = {}) {} get basePath(): string { - return this.configuration.basePath || BASE_PATH; + return this.configuration.basePath != null ? this.configuration.basePath : BASE_PATH; } get fetchApi(): FetchAPI { diff --git a/samples/client/petstore/typescript-fetch/builds/default/runtime.ts b/samples/client/petstore/typescript-fetch/builds/default/runtime.ts index dcd64eefb95..8862b423aaa 100644 --- a/samples/client/petstore/typescript-fetch/builds/default/runtime.ts +++ b/samples/client/petstore/typescript-fetch/builds/default/runtime.ts @@ -144,7 +144,7 @@ export class Configuration { constructor(private configuration: ConfigurationParameters = {}) {} get basePath(): string { - return this.configuration.basePath || BASE_PATH; + return this.configuration.basePath != null ? this.configuration.basePath : BASE_PATH; } get fetchApi(): FetchAPI { diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/src/runtime.ts b/samples/client/petstore/typescript-fetch/builds/es6-target/src/runtime.ts index dcd64eefb95..8862b423aaa 100644 --- a/samples/client/petstore/typescript-fetch/builds/es6-target/src/runtime.ts +++ b/samples/client/petstore/typescript-fetch/builds/es6-target/src/runtime.ts @@ -144,7 +144,7 @@ export class Configuration { constructor(private configuration: ConfigurationParameters = {}) {} get basePath(): string { - return this.configuration.basePath || BASE_PATH; + return this.configuration.basePath != null ? this.configuration.basePath : BASE_PATH; } get fetchApi(): FetchAPI { diff --git a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/runtime.ts b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/runtime.ts index dcd64eefb95..8862b423aaa 100644 --- a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/runtime.ts +++ b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/runtime.ts @@ -144,7 +144,7 @@ export class Configuration { constructor(private configuration: ConfigurationParameters = {}) {} get basePath(): string { - return this.configuration.basePath || BASE_PATH; + return this.configuration.basePath != null ? this.configuration.basePath : BASE_PATH; } get fetchApi(): FetchAPI { diff --git a/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/runtime.ts b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/runtime.ts index dcd64eefb95..8862b423aaa 100644 --- a/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/runtime.ts +++ b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/runtime.ts @@ -144,7 +144,7 @@ export class Configuration { constructor(private configuration: ConfigurationParameters = {}) {} get basePath(): string { - return this.configuration.basePath || BASE_PATH; + return this.configuration.basePath != null ? this.configuration.basePath : BASE_PATH; } get fetchApi(): FetchAPI { diff --git a/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/src/runtime.ts b/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/src/runtime.ts index 22aa191ef5f..c84478821a0 100644 --- a/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/src/runtime.ts +++ b/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/src/runtime.ts @@ -144,7 +144,7 @@ export class Configuration { constructor(private configuration: ConfigurationParameters = {}) {} get basePath(): string { - return this.configuration.basePath || BASE_PATH; + return this.configuration.basePath != null ? this.configuration.basePath : BASE_PATH; } get fetchApi(): FetchAPI { diff --git a/samples/client/petstore/typescript-fetch/builds/with-interfaces/runtime.ts b/samples/client/petstore/typescript-fetch/builds/with-interfaces/runtime.ts index dcd64eefb95..8862b423aaa 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-interfaces/runtime.ts +++ b/samples/client/petstore/typescript-fetch/builds/with-interfaces/runtime.ts @@ -144,7 +144,7 @@ export class Configuration { constructor(private configuration: ConfigurationParameters = {}) {} get basePath(): string { - return this.configuration.basePath || BASE_PATH; + return this.configuration.basePath != null ? this.configuration.basePath : BASE_PATH; } get fetchApi(): FetchAPI { diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/runtime.ts b/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/runtime.ts index dcd64eefb95..8862b423aaa 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/runtime.ts +++ b/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/runtime.ts @@ -144,7 +144,7 @@ export class Configuration { constructor(private configuration: ConfigurationParameters = {}) {} get basePath(): string { - return this.configuration.basePath || BASE_PATH; + return this.configuration.basePath != null ? this.configuration.basePath : BASE_PATH; } get fetchApi(): FetchAPI {