Update Readme, converter helper script can now reads straight from http

This commit is contained in:
Yann Hamon 2020-10-17 17:21:33 +02:00
parent 5ada0b67e5
commit 07883b8bb4
2 changed files with 16 additions and 1 deletions

View file

@ -4,6 +4,7 @@
import yaml
import json
import sys
import urllib.request
def iteritems(d):
if hasattr(dict, "iteritems"):
@ -90,7 +91,11 @@ if len(sys.argv) == 0:
print("missing file")
exit(1)
with open(sys.argv[1]) as f:
if sys.argv[1].startswith("http"):
f = urllib.request.urlopen(sys.argv[1])
else:
f = open(sys.argv[1])
with f:
y = yaml.load(f, Loader=yaml.SafeLoader)
schema = y["spec"]["validation"]["openAPIV3Schema"]
schema = additional_properties(schema)