Feature: serve Swagger UI at /docs and raw spec at /spec.json
Problem
Litestar's built-in /schema/swagger was disabled (it crashed with 500 on dynamically generated handlers). This left apiup without any API documentation UI.
Solution
Serve two additional built-in routes on every apiup instance:
| Route |
Response |
GET /spec.json |
Raw OpenAPI spec file (JSON) |
GET /docs |
Swagger UI (CDN, points at /spec.json) |
Swagger UI is loaded from cdn.jsdelivr.net/npm/swagger-ui-dist — no extra dependencies.
Banner update
⚡ apiup 0.5.0 — My API v1.0.0
Listen: http://127.0.0.1:8080
Docs : http://127.0.0.1:8080/docs
Spec : http://127.0.0.1:8080/spec.json
Routes: 7
Tested
GET /docs → 200 Swagger UI HTML ✓
GET /spec.json → 200 raw OpenAPI JSON ✓
- All 7 mock routes still respond correctly ✓
DELETE with 204 still returns no body ✓
Labels
enhancement
Feature: serve Swagger UI at
/docsand raw spec at/spec.jsonProblem
Litestar's built-in
/schema/swaggerwas disabled (it crashed with 500 on dynamically generated handlers). This leftapiupwithout any API documentation UI.Solution
Serve two additional built-in routes on every
apiupinstance:GET /spec.jsonGET /docs/spec.json)Swagger UI is loaded from
cdn.jsdelivr.net/npm/swagger-ui-dist— no extra dependencies.Banner update
Tested
GET /docs→ 200 Swagger UI HTML ✓GET /spec.json→ 200 raw OpenAPI JSON ✓DELETEwith 204 still returns no body ✓Labels
enhancement