We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents b454bcf + e130187 commit 96aabb2Copy full SHA for 96aabb2
openapi_spec_validator/__main__.py
@@ -1,8 +1,10 @@
1
import logging
2
import argparse
3
import os
4
+import pathlib
5
import sys
6
7
+
8
from openapi_spec_validator import validate_spec_url, validate_v2_spec_url
9
from openapi_spec_validator.exceptions import ValidationError
10
@@ -33,7 +35,7 @@ def main(args=None):
33
35
validate_url = validate_spec_url
34
36
# validate
37
try:
- validate_url('file://'+filename)
38
+ validate_url(pathlib.Path(filename).as_uri())
39
except ValidationError as e:
40
print(e)
41
sys.exit(1)
setup.py
@@ -71,6 +71,7 @@ def run_tests(self):
71
"jsonschema",
72
"PyYAML>=4.2b1",
73
"six",
74
+ 'pathlib;python_version=="2.7"',
75
],
76
tests_require=[
77
"mock",
0 commit comments