Verified Commit 89a1738b authored by Dan Jones's avatar Dan Jones
Browse files

lint: fix black and flake8 errors

parent 76e6b18e
No related merge requests found
Pipeline #227533 passed with stages
in 51 seconds
......@@ -138,7 +138,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:
......@@ -164,7 +164,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
......@@ -187,10 +187,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])
import_remote_refs()
......
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