instrumenta / openapi2jsonschema

Convert OpenAPI definitions into JSON schemas for all types in the API
Other
226 stars 87 forks source link

openapijson2schema/command.py: throw error instead of proceeding #62

Open kevinburkesegment opened 1 year ago

kevinburkesegment commented 1 year ago

If we can't find either 'swagger' or 'openapi' keys, previously we'd get an UnboundLocalError because of an undefined variable. Even if we fixed that, it is probably bad to continue with command flow when the behavior is not well defined. Instead throw an error to exit execution immediately.

Fixes #16.

larsks commented 1 year ago

I'm collecting fixes in https://github.com/larsks/openapi2jsonschema. I've merged this patch into that repository.