Skip to content

Commit aa4dfe8

Browse files
authored
feat(vscode): allow specifying openapi output (#4218)
1 parent 99b34d2 commit aa4dfe8

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

web/server/openapi.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,13 @@ def generate_openapi_spec(app: FastAPI, path: str) -> None:
1111

1212

1313
if __name__ == "__main__":
14-
app = create_app()
14+
import argparse
15+
16+
parser = argparse.ArgumentParser(description="Generate OpenAPI specification")
17+
parser.add_argument(
18+
"--output", default="web/client/openapi.json", help="Path to output OpenAPI spec file"
19+
)
20+
args = parser.parse_args()
1521

16-
generate_openapi_spec(app, "web/client/openapi.json")
22+
app = create_app()
23+
generate_openapi_spec(app, args.output)

0 commit comments

Comments
 (0)