import json import os import sys from fastapi import FastAPI # Ensure project root is on sys.path ROOT = os.path.dirname(os.path.dirname(__file__)) if ROOT not in sys.path: sys.path.insert(0, ROOT) from main import app if __name__ == "__main__": # Ensure /api/v1 is part of the generated spec with open("munch-ease-backend-openapi.json", "w") as f: spec = app.openapi() json.dump(spec, f, indent=2) print("Wrote munch-ease-backend-openapi.json")