Skip to content

Commit

Permalink
Provide command-line interface
Browse files Browse the repository at this point in the history
This makes it possible to call the script as follows:

python -m swagger_spec_validator "http://petstore.swagger.io/v2/swagger.json"
  • Loading branch information
qsantos committed Dec 3, 2018
1 parent e27129e commit ebceb95
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
4 changes: 1 addition & 3 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
.
httpretty
mock
pytest
jsonschema
pyyaml
six
21 changes: 21 additions & 0 deletions swagger_spec_validator/__main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals

import argparse

from swagger_spec_validator.util import validate_spec_url


def main():
parser = argparse.ArgumentParser()
parser.description = 'Check specification against the Swagger standard'
parser.add_argument('url', type=str)
args = parser.parse_args()
validate_spec_url(args.url)


if __name__ == '__main__':
main()

0 comments on commit ebceb95

Please sign in to comment.