Commit 49895ac8 authored by Goran Pavlovic's avatar Goran Pavlovic
Browse files

Merge branch 'master' of https://github.com/pierrecdn/aiohttp-swagger into pierrecdn-master

parents c48091e7 14106510
......@@ -27,7 +27,7 @@ def _extract_swagger_docs(end_point_doc, method="get"):
# Build JSON YAML Obj
try:
end_point_swagger_doc = (
yaml.load("\n".join(end_point_doc[end_point_swagger_start:]), Loader=yaml.FullLoader)
yaml.full_load("\n".join(end_point_doc[end_point_swagger_start:]))
)
except yaml.YAMLError:
end_point_swagger_doc = {
......@@ -106,7 +106,7 @@ def generate_doc_from_each_end_point(
)
# The Swagger OBJ
swagger = yaml.load(swagger_base, Loader=yaml.FullLoader)
swagger = yaml.full_load(swagger_base)
swagger["paths"] = defaultdict(dict)
for route in app.router.routes():
......@@ -119,7 +119,7 @@ def generate_doc_from_each_end_point(
with open(route.handler.swagger_file, "r") as f:
end_point_doc = {
route.method.lower():
yaml.load(f.read(), Loader=yaml.FullLoader)
yaml.full_load(f.read())
}
except yaml.YAMLError:
end_point_doc = {
......@@ -157,7 +157,7 @@ def generate_doc_from_each_end_point(
def load_doc_from_yaml_file(doc_path: str):
loaded_yaml = yaml.load(open(doc_path, "r", encoding="utf-8").read(), Loader=yaml.FullLoader)
loaded_yaml = yaml.full_load(open(doc_path, "r").read())
return json.dumps(loaded_yaml)
......
......@@ -208,7 +208,7 @@ def test_swagger_def_decorator(test_client, loop):
@pytest.fixture
def swagger_info():
filename = abspath(join(dirname(__file__))) + "/data/example_swagger.yaml"
return yaml.load(open(filename).read())
return yaml.full_load(open(filename).read())
@asyncio.coroutine
......
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