Commit 625c8ce1 authored by Goran Pavlovic's avatar Goran Pavlovic
Browse files

Merge branch 'fix-file-handle-leak' of...

Merge branch 'fix-file-handle-leak' of https://github.com/katajakasa/aiohttp-swagger into katajakasa-fix-file-handle-leak
parents 96b15545 0264285b
......@@ -159,8 +159,9 @@ def generate_doc_from_each_end_point(
def load_doc_from_yaml_file(doc_path: str):
loaded_yaml = yaml.full_load(open(doc_path, "r").read())
return json.dumps(loaded_yaml)
with open(doc_path, "r") as f:
loaded_yaml = yaml.full_load(f.read())
return json.dumps(loaded_yaml)
__all__ = ("generate_doc_from_each_end_point", "load_doc_from_yaml_file")
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment