forked from loafle/openapi-generator-original
typescript-angular: Fix Cannot read property 'apiKey' of undefined (#9260)
* fix #9259 * avoid optional chaining operator
This commit is contained in:
+5
-1
@@ -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}}
|
||||
|
||||
+5
-1
@@ -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'];
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
+5
-1
@@ -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'];
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
+5
-1
@@ -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'];
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
+5
-1
@@ -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'];
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
+5
-1
@@ -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'];
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
+5
-1
@@ -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'];
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
+5
-1
@@ -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'];
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
+5
-1
@@ -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'];
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
+5
-1
@@ -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'];
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
+5
-1
@@ -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'];
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
+5
-1
@@ -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'];
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
+5
-1
@@ -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'];
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
+5
-1
@@ -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'];
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
+5
-1
@@ -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'];
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
+5
-1
@@ -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'];
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
+5
-1
@@ -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'];
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
+5
-1
@@ -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'];
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
+5
-1
@@ -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'];
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user