ErikWittern / openapi-snippet

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

OpenAPI 3.0 securitySchemes fix for oauth2 #42

Closed niteshhegde closed 4 years ago

niteshhegde commented 4 years ago

Fix for securitySchemes validations in OpenAPI 3.0 for type "oauth2" Ref: https://swagger.io/docs/specification/authentication/oauth2/

For OAS: "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'.

RolphH commented 4 years ago

When can this be merged?

RolphH commented 4 years ago

@ErikWittern any change to merge some of the open PR's? Otherwise I will need to use my own fork, which I rather not do.

ErikWittern commented 4 years ago

@niteshhegde Thanks for the PR!

@RolphH Very sorry for the late reply, and thanks for reminding me again. I merged also your other PR https://github.com/ErikWittern/openapi-snippet/pull/45 and published a new version 0.9.0