ErikWittern / openapi-snippet

Generates code snippets for given Swagger / Open API documents
MIT License
116 stars 67 forks source link

Issue when Security Scheme is of type oauth2 #44

Closed niteshhegde closed 4 years ago

niteshhegde commented 4 years ago

For OAS 3: { "securitySchemes": { "oauth2": { "type": "oauth2", "flows": {} } } } This causes the code to fail at: "authScheme = secDefinition.scheme.toLowerCase();", as scheme doesn't exist for type oauth2. Thereby, causing 'Cannot call method 'toLowerCase' of undefined'.

Please review https://github.com/ErikWittern/openapi-snippet/pull/42 for the fix.

ErikWittern commented 4 years ago

@niteshhegde Thank you!