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

lint: fix black and flake8 errors

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