Handle missing security definitions

Signed-off-by: Alexandre Franke <alexandre.franke@matrix.org>
pull/3684/head
Alexandre Franke 4 years ago
parent dd1b30c68a
commit 9f9e0bd3f3

@ -153,9 +153,12 @@ output = {
} }
selected_api_dir = os.path.join(api_dir, selected_api) selected_api_dir = os.path.join(api_dir, selected_api)
try:
with open(os.path.join(selected_api_dir, 'definitions', with open(os.path.join(selected_api_dir, 'definitions',
'security.yaml')) as f: 'security.yaml')) as f:
output['securityDefinitions'] = yaml.safe_load(f) output['securityDefinitions'] = yaml.safe_load(f)
except FileNotFoundError:
print("No security definitions available for this API")
for filename in os.listdir(selected_api_dir): for filename in os.listdir(selected_api_dir):
if not filename.endswith(".yaml"): if not filename.endswith(".yaml"):

Loading…
Cancel
Save