Fix typescript-nestjs services when using api_key authentication (#17708)

Closes: #17706
This commit is contained in:
Simon Hanna
2024-02-02 15:32:26 +01:00
committed by GitHub
parent 580da9978a
commit eb7d2d9fd2
7 changed files with 18 additions and 18 deletions

View File

@@ -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}}"]);
}

View File

@@ -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"];
}

View File

@@ -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"];
}

View File

@@ -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"];
}

View File

@@ -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"];
}

View File

@@ -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"];
}

View File

@@ -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"];
}