openapi-generator
openapi-generator copied to clipboard
[BUG] Multiple oauth2 flows cause typescript-node generation syntax errors
Bug Report Checklist
- [x] Have you provided a full/minimal spec to reproduce the issue?
- [x] Have you validated the input using an OpenAPI validator (example)?
- [x] Have you tested with the latest master to confirm the issue still exists?
- [x] Have you searched for related issues/PRs?
- [x] What's the actual output vs expected output?
Description
When generating SDK code using the generate command, typescript-node implementation has syntax errors in the API code when there are two or more oauth2 flows defined in the securitySchema
openapi-generator version
java -jar openapi-generator-cli.jar version
6.0.1
OpenAPI declaration file content or url
components:
securitySchemes:
oauth2:
type: oauth2
description: simple authentication
flows:
clientCredentials:
tokenUrl: https://oauth/token
scopes:
all: 'access to all scopes'
authorizationCode:
authorizationUrl: https://oauth/authorize
tokenUrl: https://oauth/token
scopes:
all: 'access to all scopes'
full file can be found here: example-api.yaml
Generation Details
java -jar openapi-generator-cli.jar generate -i example-api.yaml -g typescript-node -o sdk
Steps to reproduce
after generating the source files, you will see the following in the defaultApi.ts:
protected authentications = {
'default': <Authentication>new VoidAuth(),
'oauth2': new OAuth(),
'oauth2': new OAuth(),
}
which prevents tsc from being able to build the file.
Related issues/PRs
I have not found a related issue