Bug: GET /schema/swagger returns 500 Internal Server Error
Describe the bug
Litestar auto-generates its own OpenAPI docs at /schema/swagger. Because apiup creates handlers dynamically as closures with no type annotations, Litestar's doc generator crashes with a 500.
Steps to reproduce
apiup &
curl http://127.0.0.1:8080/schema/swagger
# → {"status_code": 500, "detail": "Internal Server Error"}
Root cause
Litestar's built-in OpenAPI doc generation is enabled by default. It cannot introspect apiup's dynamically generated handlers and crashes.
apiup already has the spec — it does not need Litestar to regenerate docs.
Fix
Disable Litestar's built-in OpenAPI generation:
return Litestar(route_handlers=handlers, openapi_config=None, debug=False)
/schema/swagger now correctly returns 404 instead of 500.
Also removed the Docs line from the startup banner as it pointed to a non-functional URL.
Environment
- apiup 0.4.0
- litestar latest
- Fedora Silverblue
Labels
bug
Bug:
GET /schema/swaggerreturns 500 Internal Server ErrorDescribe the bug
Litestar auto-generates its own OpenAPI docs at
/schema/swagger. Becauseapiupcreates handlers dynamically as closures with no type annotations, Litestar's doc generator crashes with a 500.Steps to reproduce
Root cause
Litestar's built-in OpenAPI doc generation is enabled by default. It cannot introspect
apiup's dynamically generated handlers and crashes.apiupalready has the spec — it does not need Litestar to regenerate docs.Fix
Disable Litestar's built-in OpenAPI generation:
/schema/swaggernow correctly returns 404 instead of 500.Also removed the
Docsline from the startup banner as it pointed to a non-functional URL.Environment
Labels
bug