Skip to content

Commit fffe68e

Browse files
committed
linter
1 parent ee286a6 commit fffe68e

1 file changed

Lines changed: 9 additions & 7 deletions

File tree

python/generate_schema.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,25 @@
99

1010
if __name__ == "__main__":
1111
cli_schema = json.loads(CliCommands.schema_json())
12-
with open('python/cli.schema.json', 'w') as out:
12+
with open("python/cli.schema.json", "w") as out:
1313
json.dump(cli_schema, out, indent=2)
1414

1515
combined_schemas = {}
1616
for route in api.routes:
1717
if not isinstance(route, Mount):
1818
continue # must be a built-in route like /docs
1919
mount_path = route.path
20-
openapi = get_openapi(title=f'refstudio{mount_path}', version='0.1', routes=route.app.routes)
21-
components = openapi.get('components')
20+
openapi = get_openapi(
21+
title=f"refstudio{mount_path}", version="0.1", routes=route.app.routes
22+
)
23+
components = openapi.get("components")
2224
if components:
23-
combined_schemas.update(components['schemas'])
25+
combined_schemas.update(components["schemas"])
2426

2527
# OpenAPI puts request/response definitions under "/components/schemas", but
2628
# json2ts wants them under "/definitions".
2729
output_schema = json.dumps(combined_schemas)
28-
output_schema = output_schema.replace('#/components/schemas/', '#/definitions/')
30+
output_schema = output_schema.replace("#/components/schemas/", "#/definitions/")
2931
schema = json.loads(output_schema)
30-
with open('python/api.schema.json', 'w') as out:
31-
json.dump({'definitions': schema}, out, indent=2)
32+
with open("python/api.schema.json", "w") as out:
33+
json.dump({"definitions": schema}, out, indent=2)

0 commit comments

Comments
 (0)