-
-
Notifications
You must be signed in to change notification settings - Fork 7.3k
Closed
Description
Actual output
{{#authMethods}}
authenticationPromise = authenticationPromise.then(() => this.authentications.{{name}}.applyToRequest(localVarRequestOptions));
{{/authMethods}}
Expected output
{{#authMethods}}
{{#isApiKey}}
if (this.authentications.{{name}}.apiKey) {
authenticationPromise = authenticationPromise.then(() => this.authentications.{{name}}.applyToRequest(localVarRequestOptions));
}
{{/isApiKey}}
{{#isBasicBasic}}
if (this.authentications.{{name}}.username && this.authentications.{{name}}.password) {
authenticationPromise = authenticationPromise.then(() => this.authentications.{{name}}.applyToRequest(localVarRequestOptions));
}
{{/isBasicBasic}}
{{#isBasicBearer}}
if (this.authentications.{{name}}.accessToken) {
authenticationPromise = authenticationPromise.then(() => this.authentications.{{name}}.applyToRequest(localVarRequestOptions));
}
{{/isBasicBearer}}
{{#isOAuth}}
if (this.authentications.{{name}}.accessToken) {
authenticationPromise = authenticationPromise.then(() => this.authentications.{{name}}.applyToRequest(localVarRequestOptions));
}
{{/isOAuth}}
{{/authMethods}}
Bug Report Checklist
- [+] Have you provided a full/minimal spec to reproduce the issue?
- [+] Have you validated the input using an OpenAPI validator (example)?
- [+] What's the version of OpenAPI Generator used?
- [+] Have you search for related issues/PRs?
- [+] What's the actual output vs expected output?
- [Optional] Bounty to sponsor the fix (example)
Description
All supported authentication method (not configured) applied to request in generated api client class
openapi-generator version
Master (4.2.3-SNAPSHOT)
OpenAPI declaration file content or url
Command line used for generation
generate -l typescript-node
Steps to reproduce
- generate apiclient for typescript-node with support of several authentication methods (e.g apikey & oauth)
- setup accesToken for oauth
- use any available method to create request
- check request data: oauth heder & empty apikey applied to request