16 lines
344 B
Python
16 lines
344 B
Python
|
|
import json
|
||
|
|
import os
|
||
|
|
import sys
|
||
|
|
|
||
|
|
# 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__":
|
||
|
|
with open("openapi.json", "w") as f:
|
||
|
|
json.dump(app.openapi(), f, indent=2)
|
||
|
|
print("Wrote openapi.json")
|