Skip to content

Commit 3515b77

Browse files
committed
🐛 Fixing URI forge for Windows
In order to allow Windows user to use this smart tool, this PR provide a solution proposed by @kearnh in Issuer #50.
1 parent c40cb75 commit 3515b77

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

openapi_spec_validator/__main__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
import logging
22
import argparse
33
import os
4+
import pathlib
45
import sys
56

7+
68
from openapi_spec_validator import validate_spec_url, validate_v2_spec_url
79
from openapi_spec_validator.exceptions import ValidationError
810

@@ -33,7 +35,7 @@ def main(args=None):
3335
validate_url = validate_spec_url
3436
# validate
3537
try:
36-
validate_url('file://'+filename)
38+
validate_url(pathlib.Path(filename).as_uri())
3739
except ValidationError as e:
3840
print(e)
3941
sys.exit(1)

0 commit comments

Comments
 (0)