feat(nodes): add script to generate openapi.json

This commit is contained in:
psychedelicious 2023-04-05 23:48:39 +10:00
parent 591d6bcdda
commit d6104a3cea

View File

@ -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)