Skip to content
This repository has been archived by the owner on Feb 25, 2022. It is now read-only.

CLI arguments are not validated correctly. #652

Closed
carltongibson opened this issue Mar 25, 2019 · 0 comments
Closed

CLI arguments are not validated correctly. #652

carltongibson opened this issue Mar 25, 2019 · 0 comments

Comments

@carltongibson
Copy link

This is related to #650 (which is about --path).

CLI arguments aren't enforced, or given sensible defaults.

The one I hit is --format. If you don't provide this there is no error until you get to the final "Valid schema" message. At that point you get a totally mysterious KeyError:

(apistar) ~/Desktop $ apistar validate --path schema.yml 
Traceback (most recent call last):
...
  File ".../apistar/cli.py", line 163, in validate
    }[format]
KeyError: None

Cracking open cli.py, format there is the missing CLI argument. Sending --format=openapi resolves the issue.

format should be required, so as to provide a helpful error message.
Maybe it should default to openapi...

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant