Skip to content

Commit

Permalink
Issue instrumenta#32: Windows: urlopen error
Browse files Browse the repository at this point in the history
For windows local path the base_uri parameter of JsonRef.replace_refs(...) requires three slashes i.e. file:///d:\mydir\subdir...
  • Loading branch information
poutysquire10 authored Feb 4, 2020
1 parent 1ca501f commit 5fc057f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion openapi2jsonschema/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,12 @@ def default(output, schema, prefix, stand_alone, expanded, kubernetes, strict):
specification = updated

if stand_alone:
base = "file://%s/%s/" % (os.getcwd(), output)
###base = "file://%s/%s/" % (os.getcwd(), output)
if os.name == 'nt':
base = "file:///%s/%s/" % (os.getcwd(), output)
else:
base = "file://%s/%s/" % (os.getcwd(), output)

specification = JsonRef.replace_refs(
specification, base_uri=base)

Expand Down

0 comments on commit 5fc057f

Please sign in to comment.