diff --git a/modules/openapi-generator/src/main/resources/typescript-angular/api.service.mustache b/modules/openapi-generator/src/main/resources/typescript-angular/api.service.mustache index 38ffa081b85a..35c15e870c65 100644 --- a/modules/openapi-generator/src/main/resources/typescript-angular/api.service.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-angular/api.service.mustache @@ -278,18 +278,19 @@ export class {{classname}} { {{#authMethods}} // authentication ({{name}}) required {{#isApiKey}} + if (this.configuration.apiKeys) { + {{! Fallback behaviour may be removed for 5.0 release. See #5062 }} + const key: string | undefined = this.configuration.apiKeys["{{name}}"] || this.configuration.apiKeys["{{keyParamName}}"]; + if (key) { {{#isKeyInHeader}} - if (this.configuration.apiKeys && this.configuration.apiKeys["{{keyParamName}}"]) { - {{#useHttpClient}}headers = {{/useHttpClient}}headers.set('{{keyParamName}}', this.configuration.apiKeys["{{keyParamName}}"]); - } - + {{#useHttpClient}}headers = {{/useHttpClient}}headers.set('{{keyParamName}}', key); {{/isKeyInHeader}} {{#isKeyInQuery}} - if (this.configuration.apiKeys && this.configuration.apiKeys["{{keyParamName}}"]) { - {{#useHttpClient}}queryParameters = {{/useHttpClient}}queryParameters.set('{{keyParamName}}', this.configuration.apiKeys["{{keyParamName}}"]); + {{#useHttpClient}}queryParameters = {{/useHttpClient}}queryParameters.set('{{keyParamName}}', key); +{{/isKeyInQuery}} + } } -{{/isKeyInQuery}} {{/isApiKey}} {{#isBasic}} {{#isBasicBasic}} diff --git a/samples/client/petstore/typescript-angular-v2/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v2/default/api/pet.service.ts index a2a05d7464ed..8a80a3026a05 100644 --- a/samples/client/petstore/typescript-angular-v2/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v2/default/api/pet.service.ts @@ -468,8 +468,11 @@ export class PetService { let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 // authentication (api_key) required - if (this.configuration.apiKeys && this.configuration.apiKeys["api_key"]) { - headers.set('api_key', this.configuration.apiKeys["api_key"]); + if (this.configuration.apiKeys) { + const key: string | undefined = this.configuration.apiKeys["api_key"] || this.configuration.apiKeys["api_key"]; + if (key) { + headers.set('api_key', key); + } } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; diff --git a/samples/client/petstore/typescript-angular-v2/default/api/store.service.ts b/samples/client/petstore/typescript-angular-v2/default/api/store.service.ts index 3cff4ba2c0ea..0d64a469bdff 100644 --- a/samples/client/petstore/typescript-angular-v2/default/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v2/default/api/store.service.ts @@ -199,8 +199,11 @@ export class StoreService { let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 // authentication (api_key) required - if (this.configuration.apiKeys && this.configuration.apiKeys["api_key"]) { - headers.set('api_key', this.configuration.apiKeys["api_key"]); + if (this.configuration.apiKeys) { + const key: string | undefined = this.configuration.apiKeys["api_key"] || this.configuration.apiKeys["api_key"]; + if (key) { + headers.set('api_key', key); + } } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; diff --git a/samples/client/petstore/typescript-angular-v2/npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v2/npm/api/pet.service.ts index a2a05d7464ed..8a80a3026a05 100644 --- a/samples/client/petstore/typescript-angular-v2/npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v2/npm/api/pet.service.ts @@ -468,8 +468,11 @@ export class PetService { let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 // authentication (api_key) required - if (this.configuration.apiKeys && this.configuration.apiKeys["api_key"]) { - headers.set('api_key', this.configuration.apiKeys["api_key"]); + if (this.configuration.apiKeys) { + const key: string | undefined = this.configuration.apiKeys["api_key"] || this.configuration.apiKeys["api_key"]; + if (key) { + headers.set('api_key', key); + } } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; diff --git a/samples/client/petstore/typescript-angular-v2/npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v2/npm/api/store.service.ts index 3cff4ba2c0ea..0d64a469bdff 100644 --- a/samples/client/petstore/typescript-angular-v2/npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v2/npm/api/store.service.ts @@ -199,8 +199,11 @@ export class StoreService { let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 // authentication (api_key) required - if (this.configuration.apiKeys && this.configuration.apiKeys["api_key"]) { - headers.set('api_key', this.configuration.apiKeys["api_key"]); + if (this.configuration.apiKeys) { + const key: string | undefined = this.configuration.apiKeys["api_key"] || this.configuration.apiKeys["api_key"]; + if (key) { + headers.set('api_key', key); + } } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; diff --git a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/pet.service.ts b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/pet.service.ts index b3230d244e2a..2d153ab2ba5f 100644 --- a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/pet.service.ts @@ -471,8 +471,11 @@ export class PetService implements PetServiceInterface { let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 // authentication (api_key) required - if (this.configuration.apiKeys && this.configuration.apiKeys["api_key"]) { - headers.set('api_key', this.configuration.apiKeys["api_key"]); + if (this.configuration.apiKeys) { + const key: string | undefined = this.configuration.apiKeys["api_key"] || this.configuration.apiKeys["api_key"]; + if (key) { + headers.set('api_key', key); + } } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; diff --git a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/store.service.ts b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/store.service.ts index f945e50874c8..5aa28658557e 100644 --- a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/store.service.ts @@ -202,8 +202,11 @@ export class StoreService implements StoreServiceInterface { let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 // authentication (api_key) required - if (this.configuration.apiKeys && this.configuration.apiKeys["api_key"]) { - headers.set('api_key', this.configuration.apiKeys["api_key"]); + if (this.configuration.apiKeys) { + const key: string | undefined = this.configuration.apiKeys["api_key"] || this.configuration.apiKeys["api_key"]; + if (key) { + headers.set('api_key', key); + } } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; diff --git a/samples/client/petstore/typescript-angular-v4.3/npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v4.3/npm/api/pet.service.ts index b5bf94fba2c6..b19fbc6c6bfe 100644 --- a/samples/client/petstore/typescript-angular-v4.3/npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v4.3/npm/api/pet.service.ts @@ -358,8 +358,11 @@ export class PetService { let headers = this.defaultHeaders; // authentication (api_key) required - if (this.configuration.apiKeys && this.configuration.apiKeys["api_key"]) { - headers = headers.set('api_key', this.configuration.apiKeys["api_key"]); + if (this.configuration.apiKeys) { + const key: string | undefined = this.configuration.apiKeys["api_key"] || this.configuration.apiKeys["api_key"]; + if (key) { + headers = headers.set('api_key', key); + } } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; diff --git a/samples/client/petstore/typescript-angular-v4.3/npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v4.3/npm/api/store.service.ts index 6e521f729e49..2a335a30d08b 100644 --- a/samples/client/petstore/typescript-angular-v4.3/npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v4.3/npm/api/store.service.ts @@ -142,8 +142,11 @@ export class StoreService { let headers = this.defaultHeaders; // authentication (api_key) required - if (this.configuration.apiKeys && this.configuration.apiKeys["api_key"]) { - headers = headers.set('api_key', this.configuration.apiKeys["api_key"]); + if (this.configuration.apiKeys) { + const key: string | undefined = this.configuration.apiKeys["api_key"] || this.configuration.apiKeys["api_key"]; + if (key) { + headers = headers.set('api_key', key); + } } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; diff --git a/samples/client/petstore/typescript-angular-v4/npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v4/npm/api/pet.service.ts index a2a05d7464ed..8a80a3026a05 100644 --- a/samples/client/petstore/typescript-angular-v4/npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v4/npm/api/pet.service.ts @@ -468,8 +468,11 @@ export class PetService { let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 // authentication (api_key) required - if (this.configuration.apiKeys && this.configuration.apiKeys["api_key"]) { - headers.set('api_key', this.configuration.apiKeys["api_key"]); + if (this.configuration.apiKeys) { + const key: string | undefined = this.configuration.apiKeys["api_key"] || this.configuration.apiKeys["api_key"]; + if (key) { + headers.set('api_key', key); + } } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; diff --git a/samples/client/petstore/typescript-angular-v4/npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v4/npm/api/store.service.ts index 3cff4ba2c0ea..0d64a469bdff 100644 --- a/samples/client/petstore/typescript-angular-v4/npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v4/npm/api/store.service.ts @@ -199,8 +199,11 @@ export class StoreService { let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 // authentication (api_key) required - if (this.configuration.apiKeys && this.configuration.apiKeys["api_key"]) { - headers.set('api_key', this.configuration.apiKeys["api_key"]); + if (this.configuration.apiKeys) { + const key: string | undefined = this.configuration.apiKeys["api_key"] || this.configuration.apiKeys["api_key"]; + if (key) { + headers.set('api_key', key); + } } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; diff --git a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/pet.service.ts index 35d6f883accc..8f9c55158bb3 100644 --- a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/pet.service.ts @@ -358,8 +358,11 @@ export class PetService { let headers = this.defaultHeaders; // authentication (api_key) required - if (this.configuration.apiKeys && this.configuration.apiKeys["api_key"]) { - headers = headers.set('api_key', this.configuration.apiKeys["api_key"]); + if (this.configuration.apiKeys) { + const key: string | undefined = this.configuration.apiKeys["api_key"] || this.configuration.apiKeys["api_key"]; + if (key) { + headers = headers.set('api_key', key); + } } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; diff --git a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/store.service.ts b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/store.service.ts index 22db3e3008b2..d27113a8b528 100644 --- a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/store.service.ts @@ -142,8 +142,11 @@ export class StoreService { let headers = this.defaultHeaders; // authentication (api_key) required - if (this.configuration.apiKeys && this.configuration.apiKeys["api_key"]) { - headers = headers.set('api_key', this.configuration.apiKeys["api_key"]); + if (this.configuration.apiKeys) { + const key: string | undefined = this.configuration.apiKeys["api_key"] || this.configuration.apiKeys["api_key"]; + if (key) { + headers = headers.set('api_key', key); + } } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; diff --git a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/pet.service.ts index 35d6f883accc..8f9c55158bb3 100644 --- a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/pet.service.ts @@ -358,8 +358,11 @@ export class PetService { let headers = this.defaultHeaders; // authentication (api_key) required - if (this.configuration.apiKeys && this.configuration.apiKeys["api_key"]) { - headers = headers.set('api_key', this.configuration.apiKeys["api_key"]); + if (this.configuration.apiKeys) { + const key: string | undefined = this.configuration.apiKeys["api_key"] || this.configuration.apiKeys["api_key"]; + if (key) { + headers = headers.set('api_key', key); + } } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; diff --git a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/store.service.ts index 22db3e3008b2..d27113a8b528 100644 --- a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/store.service.ts @@ -142,8 +142,11 @@ export class StoreService { let headers = this.defaultHeaders; // authentication (api_key) required - if (this.configuration.apiKeys && this.configuration.apiKeys["api_key"]) { - headers = headers.set('api_key', this.configuration.apiKeys["api_key"]); + if (this.configuration.apiKeys) { + const key: string | undefined = this.configuration.apiKeys["api_key"] || this.configuration.apiKeys["api_key"]; + if (key) { + headers = headers.set('api_key', key); + } } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; diff --git a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/pet.service.ts index 91bbce5b7476..1d81cf38c3d6 100644 --- a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/pet.service.ts @@ -360,8 +360,11 @@ export class PetService { let headers = this.defaultHeaders; // authentication (api_key) required - if (this.configuration.apiKeys && this.configuration.apiKeys["api_key"]) { - headers = headers.set('api_key', this.configuration.apiKeys["api_key"]); + if (this.configuration.apiKeys) { + const key: string | undefined = this.configuration.apiKeys["api_key"] || this.configuration.apiKeys["api_key"]; + if (key) { + headers = headers.set('api_key', key); + } } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; diff --git a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/store.service.ts b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/store.service.ts index d169e06083a5..c6e1ea7214e6 100644 --- a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/store.service.ts @@ -144,8 +144,11 @@ export class StoreService { let headers = this.defaultHeaders; // authentication (api_key) required - if (this.configuration.apiKeys && this.configuration.apiKeys["api_key"]) { - headers = headers.set('api_key', this.configuration.apiKeys["api_key"]); + if (this.configuration.apiKeys) { + const key: string | undefined = this.configuration.apiKeys["api_key"] || this.configuration.apiKeys["api_key"]; + if (key) { + headers = headers.set('api_key', key); + } } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; diff --git a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/pet.service.ts index 91bbce5b7476..1d81cf38c3d6 100644 --- a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/pet.service.ts @@ -360,8 +360,11 @@ export class PetService { let headers = this.defaultHeaders; // authentication (api_key) required - if (this.configuration.apiKeys && this.configuration.apiKeys["api_key"]) { - headers = headers.set('api_key', this.configuration.apiKeys["api_key"]); + if (this.configuration.apiKeys) { + const key: string | undefined = this.configuration.apiKeys["api_key"] || this.configuration.apiKeys["api_key"]; + if (key) { + headers = headers.set('api_key', key); + } } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; diff --git a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/store.service.ts index d169e06083a5..c6e1ea7214e6 100644 --- a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/store.service.ts @@ -144,8 +144,11 @@ export class StoreService { let headers = this.defaultHeaders; // authentication (api_key) required - if (this.configuration.apiKeys && this.configuration.apiKeys["api_key"]) { - headers = headers.set('api_key', this.configuration.apiKeys["api_key"]); + if (this.configuration.apiKeys) { + const key: string | undefined = this.configuration.apiKeys["api_key"] || this.configuration.apiKeys["api_key"]; + if (key) { + headers = headers.set('api_key', key); + } } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; diff --git a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/pet.service.ts index 35d6f883accc..8f9c55158bb3 100644 --- a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/pet.service.ts @@ -358,8 +358,11 @@ export class PetService { let headers = this.defaultHeaders; // authentication (api_key) required - if (this.configuration.apiKeys && this.configuration.apiKeys["api_key"]) { - headers = headers.set('api_key', this.configuration.apiKeys["api_key"]); + if (this.configuration.apiKeys) { + const key: string | undefined = this.configuration.apiKeys["api_key"] || this.configuration.apiKeys["api_key"]; + if (key) { + headers = headers.set('api_key', key); + } } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; diff --git a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/store.service.ts b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/store.service.ts index 22db3e3008b2..d27113a8b528 100644 --- a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/store.service.ts @@ -142,8 +142,11 @@ export class StoreService { let headers = this.defaultHeaders; // authentication (api_key) required - if (this.configuration.apiKeys && this.configuration.apiKeys["api_key"]) { - headers = headers.set('api_key', this.configuration.apiKeys["api_key"]); + if (this.configuration.apiKeys) { + const key: string | undefined = this.configuration.apiKeys["api_key"] || this.configuration.apiKeys["api_key"]; + if (key) { + headers = headers.set('api_key', key); + } } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; diff --git a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/pet.service.ts index 35d6f883accc..8f9c55158bb3 100644 --- a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/pet.service.ts @@ -358,8 +358,11 @@ export class PetService { let headers = this.defaultHeaders; // authentication (api_key) required - if (this.configuration.apiKeys && this.configuration.apiKeys["api_key"]) { - headers = headers.set('api_key', this.configuration.apiKeys["api_key"]); + if (this.configuration.apiKeys) { + const key: string | undefined = this.configuration.apiKeys["api_key"] || this.configuration.apiKeys["api_key"]; + if (key) { + headers = headers.set('api_key', key); + } } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; diff --git a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/store.service.ts index 22db3e3008b2..d27113a8b528 100644 --- a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/store.service.ts @@ -142,8 +142,11 @@ export class StoreService { let headers = this.defaultHeaders; // authentication (api_key) required - if (this.configuration.apiKeys && this.configuration.apiKeys["api_key"]) { - headers = headers.set('api_key', this.configuration.apiKeys["api_key"]); + if (this.configuration.apiKeys) { + const key: string | undefined = this.configuration.apiKeys["api_key"] || this.configuration.apiKeys["api_key"]; + if (key) { + headers = headers.set('api_key', key); + } } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; diff --git a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/pet.service.ts index 91bbce5b7476..1d81cf38c3d6 100644 --- a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/pet.service.ts @@ -360,8 +360,11 @@ export class PetService { let headers = this.defaultHeaders; // authentication (api_key) required - if (this.configuration.apiKeys && this.configuration.apiKeys["api_key"]) { - headers = headers.set('api_key', this.configuration.apiKeys["api_key"]); + if (this.configuration.apiKeys) { + const key: string | undefined = this.configuration.apiKeys["api_key"] || this.configuration.apiKeys["api_key"]; + if (key) { + headers = headers.set('api_key', key); + } } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; diff --git a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/store.service.ts b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/store.service.ts index d169e06083a5..c6e1ea7214e6 100644 --- a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/store.service.ts @@ -144,8 +144,11 @@ export class StoreService { let headers = this.defaultHeaders; // authentication (api_key) required - if (this.configuration.apiKeys && this.configuration.apiKeys["api_key"]) { - headers = headers.set('api_key', this.configuration.apiKeys["api_key"]); + if (this.configuration.apiKeys) { + const key: string | undefined = this.configuration.apiKeys["api_key"] || this.configuration.apiKeys["api_key"]; + if (key) { + headers = headers.set('api_key', key); + } } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; diff --git a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/pet.service.ts index 91bbce5b7476..1d81cf38c3d6 100644 --- a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/pet.service.ts @@ -360,8 +360,11 @@ export class PetService { let headers = this.defaultHeaders; // authentication (api_key) required - if (this.configuration.apiKeys && this.configuration.apiKeys["api_key"]) { - headers = headers.set('api_key', this.configuration.apiKeys["api_key"]); + if (this.configuration.apiKeys) { + const key: string | undefined = this.configuration.apiKeys["api_key"] || this.configuration.apiKeys["api_key"]; + if (key) { + headers = headers.set('api_key', key); + } } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; diff --git a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/store.service.ts index d169e06083a5..c6e1ea7214e6 100644 --- a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/store.service.ts @@ -144,8 +144,11 @@ export class StoreService { let headers = this.defaultHeaders; // authentication (api_key) required - if (this.configuration.apiKeys && this.configuration.apiKeys["api_key"]) { - headers = headers.set('api_key', this.configuration.apiKeys["api_key"]); + if (this.configuration.apiKeys) { + const key: string | undefined = this.configuration.apiKeys["api_key"] || this.configuration.apiKeys["api_key"]; + if (key) { + headers = headers.set('api_key', key); + } } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/api/pet.service.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/api/pet.service.ts index 0e2f4d61ae20..7457b9bf3c43 100644 --- a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/api/pet.service.ts @@ -402,8 +402,11 @@ export class PetService { let headers = this.defaultHeaders; // authentication (api_key) required - if (this.configuration.apiKeys && this.configuration.apiKeys["api_key"]) { - headers = headers.set('api_key', this.configuration.apiKeys["api_key"]); + if (this.configuration.apiKeys) { + const key: string | undefined = this.configuration.apiKeys["api_key"] || this.configuration.apiKeys["api_key"]; + if (key) { + headers = headers.set('api_key', key); + } } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/api/store.service.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/api/store.service.ts index ec3164d42299..b0d5dd8b4e50 100644 --- a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/api/store.service.ts @@ -157,8 +157,11 @@ export class StoreService { let headers = this.defaultHeaders; // authentication (api_key) required - if (this.configuration.apiKeys && this.configuration.apiKeys["api_key"]) { - headers = headers.set('api_key', this.configuration.apiKeys["api_key"]); + if (this.configuration.apiKeys) { + const key: string | undefined = this.configuration.apiKeys["api_key"] || this.configuration.apiKeys["api_key"]; + if (key) { + headers = headers.set('api_key', key); + } } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/pet.service.ts index 91bbce5b7476..1d81cf38c3d6 100644 --- a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/pet.service.ts @@ -360,8 +360,11 @@ export class PetService { let headers = this.defaultHeaders; // authentication (api_key) required - if (this.configuration.apiKeys && this.configuration.apiKeys["api_key"]) { - headers = headers.set('api_key', this.configuration.apiKeys["api_key"]); + if (this.configuration.apiKeys) { + const key: string | undefined = this.configuration.apiKeys["api_key"] || this.configuration.apiKeys["api_key"]; + if (key) { + headers = headers.set('api_key', key); + } } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/store.service.ts index d169e06083a5..c6e1ea7214e6 100644 --- a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/store.service.ts @@ -144,8 +144,11 @@ export class StoreService { let headers = this.defaultHeaders; // authentication (api_key) required - if (this.configuration.apiKeys && this.configuration.apiKeys["api_key"]) { - headers = headers.set('api_key', this.configuration.apiKeys["api_key"]); + if (this.configuration.apiKeys) { + const key: string | undefined = this.configuration.apiKeys["api_key"] || this.configuration.apiKeys["api_key"]; + if (key) { + headers = headers.set('api_key', key); + } } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/api/pet.service.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/api/pet.service.ts index 91bbce5b7476..1d81cf38c3d6 100644 --- a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/api/pet.service.ts @@ -360,8 +360,11 @@ export class PetService { let headers = this.defaultHeaders; // authentication (api_key) required - if (this.configuration.apiKeys && this.configuration.apiKeys["api_key"]) { - headers = headers.set('api_key', this.configuration.apiKeys["api_key"]); + if (this.configuration.apiKeys) { + const key: string | undefined = this.configuration.apiKeys["api_key"] || this.configuration.apiKeys["api_key"]; + if (key) { + headers = headers.set('api_key', key); + } } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/api/store.service.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/api/store.service.ts index d169e06083a5..c6e1ea7214e6 100644 --- a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/api/store.service.ts @@ -144,8 +144,11 @@ export class StoreService { let headers = this.defaultHeaders; // authentication (api_key) required - if (this.configuration.apiKeys && this.configuration.apiKeys["api_key"]) { - headers = headers.set('api_key', this.configuration.apiKeys["api_key"]); + if (this.configuration.apiKeys) { + const key: string | undefined = this.configuration.apiKeys["api_key"] || this.configuration.apiKeys["api_key"]; + if (key) { + headers = headers.set('api_key', key); + } } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept;