Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Communications Backbone System
backbone-message-format
Commits
89a1738b
Verified
Commit
89a1738b
authored
6 months ago
by
Dan Jones
Browse files
Options
Download
Email Patches
Plain Diff
lint: fix black and flake8 errors
parent
76e6b18e
No related merge requests found
Pipeline
#227533
passed with stages
in 51 seconds
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
24 deletions
+21
-24
generate_schema_config.py
generate_schema_config.py
+21
-24
No files found.
generate_schema_config.py
View file @
89a1738b
...
...
@@ -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
()
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment