Skip to content

Commit caf7bc2

Browse files
authored
Merge pull request #9978 from elimity-com/pass-strict-null-checks
Pass strict null checks
2 parents f45953b + e2fc476 commit caf7bc2

File tree

32 files changed

+97
-29
lines changed

32 files changed

+97
-29
lines changed

modules/swagger-codegen/src/main/resources/typescript-angular/api.service.mustache

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,13 +197,13 @@ export class {{classname}} {
197197
// authentication ({{name}}) required
198198
{{#isApiKey}}
199199
{{#isKeyInHeader}}
200-
if (this.configuration.apiKeys["{{keyParamName}}"]) {
200+
if (this.configuration.apiKeys && this.configuration.apiKeys["{{keyParamName}}"]) {
201201
{{#useHttpClient}}headers = {{/useHttpClient}}headers.set('{{keyParamName}}', this.configuration.apiKeys["{{keyParamName}}"]);
202202
}
203203

204204
{{/isKeyInHeader}}
205205
{{#isKeyInQuery}}
206-
if (this.configuration.apiKeys["{{keyParamName}}"]) {
206+
if (this.configuration.apiKeys && this.configuration.apiKeys["{{keyParamName}}"]) {
207207
{{#useHttpClient}}queryParameters = {{/useHttpClient}}queryParameters.set('{{keyParamName}}', this.configuration.apiKeys["{{keyParamName}}"]);
208208
}
209209

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.4.3-SNAPSHOT
1+
2.4.12-SNAPSHOT

samples/client/petstore/typescript-angular-v2/default/api/pet.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ export class PetService {
427427
let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845
428428

429429
// authentication (api_key) required
430-
if (this.configuration.apiKeys["api_key"]) {
430+
if (this.configuration.apiKeys && this.configuration.apiKeys["api_key"]) {
431431
headers.set('api_key', this.configuration.apiKeys["api_key"]);
432432
}
433433

samples/client/petstore/typescript-angular-v2/default/api/store.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ export class StoreService {
172172
let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845
173173

174174
// authentication (api_key) required
175-
if (this.configuration.apiKeys["api_key"]) {
175+
if (this.configuration.apiKeys && this.configuration.apiKeys["api_key"]) {
176176
headers.set('api_key', this.configuration.apiKeys["api_key"]);
177177
}
178178

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.4.3-SNAPSHOT
1+
2.4.12-SNAPSHOT

samples/client/petstore/typescript-angular-v2/npm/api/pet.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ export class PetService {
427427
let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845
428428

429429
// authentication (api_key) required
430-
if (this.configuration.apiKeys["api_key"]) {
430+
if (this.configuration.apiKeys && this.configuration.apiKeys["api_key"]) {
431431
headers.set('api_key', this.configuration.apiKeys["api_key"]);
432432
}
433433

samples/client/petstore/typescript-angular-v2/npm/api/store.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ export class StoreService {
172172
let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845
173173

174174
// authentication (api_key) required
175-
if (this.configuration.apiKeys["api_key"]) {
175+
if (this.configuration.apiKeys && this.configuration.apiKeys["api_key"]) {
176176
headers.set('api_key', this.configuration.apiKeys["api_key"]);
177177
}
178178

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.4.3-SNAPSHOT
1+
2.4.12-SNAPSHOT

samples/client/petstore/typescript-angular-v2/with-interfaces/api/pet.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ export class PetService implements PetServiceInterface {
428428
let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845
429429

430430
// authentication (api_key) required
431-
if (this.configuration.apiKeys["api_key"]) {
431+
if (this.configuration.apiKeys && this.configuration.apiKeys["api_key"]) {
432432
headers.set('api_key', this.configuration.apiKeys["api_key"]);
433433
}
434434

samples/client/petstore/typescript-angular-v2/with-interfaces/api/store.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ export class StoreService implements StoreServiceInterface {
173173
let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845
174174

175175
// authentication (api_key) required
176-
if (this.configuration.apiKeys["api_key"]) {
176+
if (this.configuration.apiKeys && this.configuration.apiKeys["api_key"]) {
177177
headers.set('api_key', this.configuration.apiKeys["api_key"]);
178178
}
179179

0 commit comments

Comments
 (0)