mirror of
https://github.com/jlengrand/openapi-generator.git
synced 2026-03-10 08:31:23 +00:00
Fix typescript-nestjs services when using api_key authentication (#17708)
Closes: #17706
This commit is contained in:
@@ -121,7 +121,7 @@ export class {{classname}} {
|
||||
// authentication ({{name}}) required
|
||||
{{#isApiKey}}
|
||||
{{#isKeyInHeader}}
|
||||
if (this.configuration.apiKeys["{{keyParamName}}"]) {
|
||||
if (this.configuration.apiKeys?.["{{keyParamName}}"]) {
|
||||
headers['{{keyParamName}}'] = this.configuration.apiKeys["{{keyParamName}}"];
|
||||
}
|
||||
|
||||
@@ -130,7 +130,7 @@ export class {{classname}} {
|
||||
{{^hasQueryParams}}
|
||||
let queryParameters = new URLSearchParams();
|
||||
{{/hasQueryParams}}
|
||||
if (this.configuration.apiKeys["{{keyParamName}}"]) {
|
||||
if (this.configuration.apiKeys?.["{{keyParamName}}"]) {
|
||||
queryParameters.append('{{keyParamName}}', this.configuration.apiKeys["{{keyParamName}}"]);
|
||||
}
|
||||
|
||||
|
||||
@@ -255,7 +255,7 @@ export class PetService {
|
||||
let headers = {...this.defaultHeaders};
|
||||
|
||||
// authentication (api_key) required
|
||||
if (this.configuration.apiKeys["api_key"]) {
|
||||
if (this.configuration.apiKeys?.["api_key"]) {
|
||||
headers['api_key'] = this.configuration.apiKeys["api_key"];
|
||||
}
|
||||
|
||||
|
||||
@@ -85,7 +85,7 @@ export class StoreService {
|
||||
let headers = {...this.defaultHeaders};
|
||||
|
||||
// authentication (api_key) required
|
||||
if (this.configuration.apiKeys["api_key"]) {
|
||||
if (this.configuration.apiKeys?.["api_key"]) {
|
||||
headers['api_key'] = this.configuration.apiKeys["api_key"];
|
||||
}
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ export class UserService {
|
||||
let headers = {...this.defaultHeaders};
|
||||
|
||||
// authentication (api_key) required
|
||||
if (this.configuration.apiKeys["api_key"]) {
|
||||
if (this.configuration.apiKeys?.["api_key"]) {
|
||||
headers['api_key'] = this.configuration.apiKeys["api_key"];
|
||||
}
|
||||
|
||||
@@ -101,7 +101,7 @@ export class UserService {
|
||||
let headers = {...this.defaultHeaders};
|
||||
|
||||
// authentication (api_key) required
|
||||
if (this.configuration.apiKeys["api_key"]) {
|
||||
if (this.configuration.apiKeys?.["api_key"]) {
|
||||
headers['api_key'] = this.configuration.apiKeys["api_key"];
|
||||
}
|
||||
|
||||
@@ -146,7 +146,7 @@ export class UserService {
|
||||
let headers = {...this.defaultHeaders};
|
||||
|
||||
// authentication (api_key) required
|
||||
if (this.configuration.apiKeys["api_key"]) {
|
||||
if (this.configuration.apiKeys?.["api_key"]) {
|
||||
headers['api_key'] = this.configuration.apiKeys["api_key"];
|
||||
}
|
||||
|
||||
@@ -191,7 +191,7 @@ export class UserService {
|
||||
let headers = {...this.defaultHeaders};
|
||||
|
||||
// authentication (api_key) required
|
||||
if (this.configuration.apiKeys["api_key"]) {
|
||||
if (this.configuration.apiKeys?.["api_key"]) {
|
||||
headers['api_key'] = this.configuration.apiKeys["api_key"];
|
||||
}
|
||||
|
||||
@@ -311,7 +311,7 @@ export class UserService {
|
||||
let headers = {...this.defaultHeaders};
|
||||
|
||||
// authentication (api_key) required
|
||||
if (this.configuration.apiKeys["api_key"]) {
|
||||
if (this.configuration.apiKeys?.["api_key"]) {
|
||||
headers['api_key'] = this.configuration.apiKeys["api_key"];
|
||||
}
|
||||
|
||||
@@ -355,7 +355,7 @@ export class UserService {
|
||||
let headers = {...this.defaultHeaders};
|
||||
|
||||
// authentication (api_key) required
|
||||
if (this.configuration.apiKeys["api_key"]) {
|
||||
if (this.configuration.apiKeys?.["api_key"]) {
|
||||
headers['api_key'] = this.configuration.apiKeys["api_key"];
|
||||
}
|
||||
|
||||
|
||||
@@ -256,7 +256,7 @@ export class PetService {
|
||||
let headers = {...this.defaultHeaders};
|
||||
|
||||
// authentication (api_key) required
|
||||
if (this.configuration.apiKeys["api_key"]) {
|
||||
if (this.configuration.apiKeys?.["api_key"]) {
|
||||
headers['api_key'] = this.configuration.apiKeys["api_key"];
|
||||
}
|
||||
|
||||
|
||||
@@ -86,7 +86,7 @@ export class StoreService {
|
||||
let headers = {...this.defaultHeaders};
|
||||
|
||||
// authentication (api_key) required
|
||||
if (this.configuration.apiKeys["api_key"]) {
|
||||
if (this.configuration.apiKeys?.["api_key"]) {
|
||||
headers['api_key'] = this.configuration.apiKeys["api_key"];
|
||||
}
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@ export class UserService {
|
||||
let headers = {...this.defaultHeaders};
|
||||
|
||||
// authentication (api_key) required
|
||||
if (this.configuration.apiKeys["api_key"]) {
|
||||
if (this.configuration.apiKeys?.["api_key"]) {
|
||||
headers['api_key'] = this.configuration.apiKeys["api_key"];
|
||||
}
|
||||
|
||||
@@ -102,7 +102,7 @@ export class UserService {
|
||||
let headers = {...this.defaultHeaders};
|
||||
|
||||
// authentication (api_key) required
|
||||
if (this.configuration.apiKeys["api_key"]) {
|
||||
if (this.configuration.apiKeys?.["api_key"]) {
|
||||
headers['api_key'] = this.configuration.apiKeys["api_key"];
|
||||
}
|
||||
|
||||
@@ -147,7 +147,7 @@ export class UserService {
|
||||
let headers = {...this.defaultHeaders};
|
||||
|
||||
// authentication (api_key) required
|
||||
if (this.configuration.apiKeys["api_key"]) {
|
||||
if (this.configuration.apiKeys?.["api_key"]) {
|
||||
headers['api_key'] = this.configuration.apiKeys["api_key"];
|
||||
}
|
||||
|
||||
@@ -192,7 +192,7 @@ export class UserService {
|
||||
let headers = {...this.defaultHeaders};
|
||||
|
||||
// authentication (api_key) required
|
||||
if (this.configuration.apiKeys["api_key"]) {
|
||||
if (this.configuration.apiKeys?.["api_key"]) {
|
||||
headers['api_key'] = this.configuration.apiKeys["api_key"];
|
||||
}
|
||||
|
||||
@@ -312,7 +312,7 @@ export class UserService {
|
||||
let headers = {...this.defaultHeaders};
|
||||
|
||||
// authentication (api_key) required
|
||||
if (this.configuration.apiKeys["api_key"]) {
|
||||
if (this.configuration.apiKeys?.["api_key"]) {
|
||||
headers['api_key'] = this.configuration.apiKeys["api_key"];
|
||||
}
|
||||
|
||||
@@ -356,7 +356,7 @@ export class UserService {
|
||||
let headers = {...this.defaultHeaders};
|
||||
|
||||
// authentication (api_key) required
|
||||
if (this.configuration.apiKeys["api_key"]) {
|
||||
if (this.configuration.apiKeys?.["api_key"]) {
|
||||
headers['api_key'] = this.configuration.apiKeys["api_key"];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user