Fix dump-swagger.py
for PyYAML 6.0. (#3443)
PyYAML 6.0 was released yesterday, and it finally drops support for `yaml.load` without a `loader` argument, which has been deprecated since 2017. We don't use any fancy yaml objects, so `safe_load` should be fine.
This commit is contained in:
parent
6062e5052d
commit
265ebef584
1 changed files with 2 additions and 2 deletions
|
@ -93,7 +93,7 @@ output = {
|
|||
cs_api_dir = os.path.join(api_dir, 'client-server')
|
||||
with open(os.path.join(cs_api_dir, 'definitions',
|
||||
'security.yaml')) as f:
|
||||
output['securityDefinitions'] = yaml.load(f)
|
||||
output['securityDefinitions'] = yaml.safe_load(f)
|
||||
|
||||
for filename in os.listdir(cs_api_dir):
|
||||
if not filename.endswith(".yaml"):
|
||||
|
@ -102,7 +102,7 @@ for filename in os.listdir(cs_api_dir):
|
|||
|
||||
print("Reading swagger API: %s" % filepath)
|
||||
with open(filepath, "r") as f:
|
||||
api = yaml.load(f.read())
|
||||
api = yaml.safe_load(f.read())
|
||||
api = units.resolve_references(filepath, api)
|
||||
|
||||
basePath = api['basePath']
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue