Skip to content

Bug: GET /schema/swagger returns 500 Internal Server Error #12

@roebi

Description

@roebi

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingtriage

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions