Verified Commit bbded930 authored by Dan Jones's avatar Dan Jones
Browse files

lint: fix black and flake8 errors

parent 673cab5c
......@@ -146,7 +146,7 @@ def nested_replace(source, key, value, replace_with):
Find all instances of a key value pair in a nested
dictionary and replace the value with replace_with
"""
for k,v in source.items():
for k, v in source.items():
if k == key and v == value:
source[k] = replace_with
elif type(v) is list:
......@@ -172,7 +172,7 @@ def inject_schema(schema, remote_ref):
local_name = rename_ref(remote_ref)
local_ref = f"#/components/schemas/{local_name}"
ref_schema = resolve_ref(remote_ref)
if (ref_schema is not None):
if ref_schema is not None:
nested_replace(schema, "$ref", remote_ref, local_ref)
schema["components"]["schemas"][local_name] = ref_schema
return True
......@@ -195,10 +195,7 @@ def import_remote_refs():
"https://geojson.org/schema/Polygon.json",
]
return all([
inject_schema(swagger_config, ref)
for ref in ref_imports
])
return all([inject_schema(swagger_config, ref) for ref in ref_imports])
def configure_flask(swagger_config):
......
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