diff --git a/invokeai/app/util/generate_openapi_json.py b/invokeai/app/util/generate_openapi_json.py new file mode 100644 index 0000000000..f0c7b8f6cc --- /dev/null +++ b/invokeai/app/util/generate_openapi_json.py @@ -0,0 +1,15 @@ +# Generate the OpenAPI schema json + +import json +from invokeai.app.api_app import app +from fastapi.openapi.utils import get_openapi + +openapi_doc = get_openapi( + title=app.title, + version=app.version, + openapi_version=app.openapi_version, + routes=app.routes, +) + +with open("./openapi.json", "w") as f: + json.dump(openapi_doc, f)