"""Write the OpenAPI schema to openapi.json — consumed by the frontend's
`npm run generate` (openapi-typescript). Stage 1 of the Docker build runs
this; locally run it after any router/schema change."""
import json

from app.main import create_app

app = create_app()
with open("openapi.json", "w", encoding="utf-8") as f:
    json.dump(app.openapi(), f, indent=1, sort_keys=True)
print("wrote openapi.json")
