From d6104a3cea041c0a0bbf7f3a0cde1b4e8ba47ac1 Mon Sep 17 00:00:00 2001 From: psychedelicious <4822129+psychedelicious@users.noreply.github.com> Date: Wed, 5 Apr 2023 23:48:39 +1000 Subject: [PATCH] feat(nodes): add script to generate openapi.json --- invokeai/app/util/generate_openapi_json.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 invokeai/app/util/generate_openapi_json.py 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)