diff --git a/modules/openapi-generator/src/main/resources/typescript-angular/configuration.mustache b/modules/openapi-generator/src/main/resources/typescript-angular/configuration.mustache index 02632f0c64c7..40aaec67f477 100644 --- a/modules/openapi-generator/src/main/resources/typescript-angular/configuration.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-angular/configuration.mustache @@ -64,7 +64,11 @@ export class {{configurationClassName}} { {{#isApiKey}} this.credentials['{{name}}'] = () => { {{! Fallback behaviour may be removed for 5.0 release. See #5062 }} - return this.apiKeys['{{name}}'] || this.apiKeys['{{keyParamName}}']; + if (this.apiKeys === null || this.apiKeys === undefined) { + return undefined; + } else { + return this.apiKeys['{{name}}'] || this.apiKeys['{{keyParamName}}']; + } }; {{/isApiKey}} {{#isBasic}} diff --git a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/configuration.ts b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/configuration.ts index 38126642420d..6fc0f80d973f 100644 --- a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/configuration.ts +++ b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/configuration.ts @@ -61,7 +61,11 @@ export class Configuration { // init default api_key credential if (!this.credentials['api_key']) { this.credentials['api_key'] = () => { - return this.apiKeys['api_key'] || this.apiKeys['api_key']; + if (this.apiKeys === null || this.apiKeys === undefined) { + return undefined; + } else { + return this.apiKeys['api_key'] || this.apiKeys['api_key']; + } }; } diff --git a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/configuration.ts b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/configuration.ts index 38126642420d..6fc0f80d973f 100644 --- a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/configuration.ts +++ b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/configuration.ts @@ -61,7 +61,11 @@ export class Configuration { // init default api_key credential if (!this.credentials['api_key']) { this.credentials['api_key'] = () => { - return this.apiKeys['api_key'] || this.apiKeys['api_key']; + if (this.apiKeys === null || this.apiKeys === undefined) { + return undefined; + } else { + return this.apiKeys['api_key'] || this.apiKeys['api_key']; + } }; } diff --git a/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/default/configuration.ts b/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/default/configuration.ts index 38126642420d..6fc0f80d973f 100644 --- a/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/default/configuration.ts +++ b/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/default/configuration.ts @@ -61,7 +61,11 @@ export class Configuration { // init default api_key credential if (!this.credentials['api_key']) { this.credentials['api_key'] = () => { - return this.apiKeys['api_key'] || this.apiKeys['api_key']; + if (this.apiKeys === null || this.apiKeys === undefined) { + return undefined; + } else { + return this.apiKeys['api_key'] || this.apiKeys['api_key']; + } }; } diff --git a/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/with-npm/configuration.ts b/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/with-npm/configuration.ts index 38126642420d..6fc0f80d973f 100644 --- a/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/with-npm/configuration.ts +++ b/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/with-npm/configuration.ts @@ -61,7 +61,11 @@ export class Configuration { // init default api_key credential if (!this.credentials['api_key']) { this.credentials['api_key'] = () => { - return this.apiKeys['api_key'] || this.apiKeys['api_key']; + if (this.apiKeys === null || this.apiKeys === undefined) { + return undefined; + } else { + return this.apiKeys['api_key'] || this.apiKeys['api_key']; + } }; } diff --git a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/configuration.ts b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/configuration.ts index 38126642420d..6fc0f80d973f 100644 --- a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/configuration.ts +++ b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/configuration.ts @@ -61,7 +61,11 @@ export class Configuration { // init default api_key credential if (!this.credentials['api_key']) { this.credentials['api_key'] = () => { - return this.apiKeys['api_key'] || this.apiKeys['api_key']; + if (this.apiKeys === null || this.apiKeys === undefined) { + return undefined; + } else { + return this.apiKeys['api_key'] || this.apiKeys['api_key']; + } }; } diff --git a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/configuration.ts b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/configuration.ts index 38126642420d..6fc0f80d973f 100644 --- a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/configuration.ts +++ b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/configuration.ts @@ -61,7 +61,11 @@ export class Configuration { // init default api_key credential if (!this.credentials['api_key']) { this.credentials['api_key'] = () => { - return this.apiKeys['api_key'] || this.apiKeys['api_key']; + if (this.apiKeys === null || this.apiKeys === undefined) { + return undefined; + } else { + return this.apiKeys['api_key'] || this.apiKeys['api_key']; + } }; } diff --git a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/configuration.ts b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/configuration.ts index 38126642420d..6fc0f80d973f 100644 --- a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/configuration.ts +++ b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/configuration.ts @@ -61,7 +61,11 @@ export class Configuration { // init default api_key credential if (!this.credentials['api_key']) { this.credentials['api_key'] = () => { - return this.apiKeys['api_key'] || this.apiKeys['api_key']; + if (this.apiKeys === null || this.apiKeys === undefined) { + return undefined; + } else { + return this.apiKeys['api_key'] || this.apiKeys['api_key']; + } }; } diff --git a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/configuration.ts b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/configuration.ts index 38126642420d..6fc0f80d973f 100644 --- a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/configuration.ts +++ b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/configuration.ts @@ -61,7 +61,11 @@ export class Configuration { // init default api_key credential if (!this.credentials['api_key']) { this.credentials['api_key'] = () => { - return this.apiKeys['api_key'] || this.apiKeys['api_key']; + if (this.apiKeys === null || this.apiKeys === undefined) { + return undefined; + } else { + return this.apiKeys['api_key'] || this.apiKeys['api_key']; + } }; } diff --git a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/configuration.ts b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/configuration.ts index 38126642420d..6fc0f80d973f 100644 --- a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/configuration.ts +++ b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/configuration.ts @@ -61,7 +61,11 @@ export class Configuration { // init default api_key credential if (!this.credentials['api_key']) { this.credentials['api_key'] = () => { - return this.apiKeys['api_key'] || this.apiKeys['api_key']; + if (this.apiKeys === null || this.apiKeys === undefined) { + return undefined; + } else { + return this.apiKeys['api_key'] || this.apiKeys['api_key']; + } }; } diff --git a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/configuration.ts b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/configuration.ts index 38126642420d..6fc0f80d973f 100644 --- a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/configuration.ts +++ b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/configuration.ts @@ -61,7 +61,11 @@ export class Configuration { // init default api_key credential if (!this.credentials['api_key']) { this.credentials['api_key'] = () => { - return this.apiKeys['api_key'] || this.apiKeys['api_key']; + if (this.apiKeys === null || this.apiKeys === undefined) { + return undefined; + } else { + return this.apiKeys['api_key'] || this.apiKeys['api_key']; + } }; } diff --git a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/configuration.ts b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/configuration.ts index 38126642420d..6fc0f80d973f 100644 --- a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/configuration.ts +++ b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/configuration.ts @@ -61,7 +61,11 @@ export class Configuration { // init default api_key credential if (!this.credentials['api_key']) { this.credentials['api_key'] = () => { - return this.apiKeys['api_key'] || this.apiKeys['api_key']; + if (this.apiKeys === null || this.apiKeys === undefined) { + return undefined; + } else { + return this.apiKeys['api_key'] || this.apiKeys['api_key']; + } }; } diff --git a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/configuration.ts b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/configuration.ts index 38126642420d..6fc0f80d973f 100644 --- a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/configuration.ts +++ b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/configuration.ts @@ -61,7 +61,11 @@ export class Configuration { // init default api_key credential if (!this.credentials['api_key']) { this.credentials['api_key'] = () => { - return this.apiKeys['api_key'] || this.apiKeys['api_key']; + if (this.apiKeys === null || this.apiKeys === undefined) { + return undefined; + } else { + return this.apiKeys['api_key'] || this.apiKeys['api_key']; + } }; } diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/configuration.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/configuration.ts index 38126642420d..6fc0f80d973f 100644 --- a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/configuration.ts +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/configuration.ts @@ -61,7 +61,11 @@ export class Configuration { // init default api_key credential if (!this.credentials['api_key']) { this.credentials['api_key'] = () => { - return this.apiKeys['api_key'] || this.apiKeys['api_key']; + if (this.apiKeys === null || this.apiKeys === undefined) { + return undefined; + } else { + return this.apiKeys['api_key'] || this.apiKeys['api_key']; + } }; } diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/configuration.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/configuration.ts index 38126642420d..6fc0f80d973f 100644 --- a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/configuration.ts +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/configuration.ts @@ -61,7 +61,11 @@ export class Configuration { // init default api_key credential if (!this.credentials['api_key']) { this.credentials['api_key'] = () => { - return this.apiKeys['api_key'] || this.apiKeys['api_key']; + if (this.apiKeys === null || this.apiKeys === undefined) { + return undefined; + } else { + return this.apiKeys['api_key'] || this.apiKeys['api_key']; + } }; } diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/configuration.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/configuration.ts index 1bd306a523eb..900c26d8ebfe 100644 --- a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/configuration.ts +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/configuration.ts @@ -61,7 +61,11 @@ export class PetStoreConfiguration { // init default api_key credential if (!this.credentials['api_key']) { this.credentials['api_key'] = () => { - return this.apiKeys['api_key'] || this.apiKeys['api_key']; + if (this.apiKeys === null || this.apiKeys === undefined) { + return undefined; + } else { + return this.apiKeys['api_key'] || this.apiKeys['api_key']; + } }; } diff --git a/samples/client/petstore/typescript-angular-v9-provided-in-any/builds/default/configuration.ts b/samples/client/petstore/typescript-angular-v9-provided-in-any/builds/default/configuration.ts index 38126642420d..6fc0f80d973f 100644 --- a/samples/client/petstore/typescript-angular-v9-provided-in-any/builds/default/configuration.ts +++ b/samples/client/petstore/typescript-angular-v9-provided-in-any/builds/default/configuration.ts @@ -61,7 +61,11 @@ export class Configuration { // init default api_key credential if (!this.credentials['api_key']) { this.credentials['api_key'] = () => { - return this.apiKeys['api_key'] || this.apiKeys['api_key']; + if (this.apiKeys === null || this.apiKeys === undefined) { + return undefined; + } else { + return this.apiKeys['api_key'] || this.apiKeys['api_key']; + } }; } diff --git a/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/configuration.ts b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/configuration.ts index 38126642420d..6fc0f80d973f 100644 --- a/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/configuration.ts +++ b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/configuration.ts @@ -61,7 +61,11 @@ export class Configuration { // init default api_key credential if (!this.credentials['api_key']) { this.credentials['api_key'] = () => { - return this.apiKeys['api_key'] || this.apiKeys['api_key']; + if (this.apiKeys === null || this.apiKeys === undefined) { + return undefined; + } else { + return this.apiKeys['api_key'] || this.apiKeys['api_key']; + } }; } diff --git a/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/configuration.ts b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/configuration.ts index 38126642420d..6fc0f80d973f 100644 --- a/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/configuration.ts +++ b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/configuration.ts @@ -61,7 +61,11 @@ export class Configuration { // init default api_key credential if (!this.credentials['api_key']) { this.credentials['api_key'] = () => { - return this.apiKeys['api_key'] || this.apiKeys['api_key']; + if (this.apiKeys === null || this.apiKeys === undefined) { + return undefined; + } else { + return this.apiKeys['api_key'] || this.apiKeys['api_key']; + } }; }