mirror of
https://github.com/kennethreitz/responder.git
synced 2026-06-21 15:00:57 +00:00
e1a6a60cbb
Features:
- WebSocket handlers receive path params and dependencies by declaring
them after `ws` — injection is opt-in by name, so handler(ws)
signatures keep working. Providers taking a parameter receive the
WebSocket; generator teardown runs when the handler finishes
- OpenAPI 3.1 support (openapi="3.1.0")
- OpenAPI schema endpoint serves JSON via Accept negotiation, or always
when openapi_route ends in .json
- Path parameters are auto-documented in the OpenAPI spec, typed from
route convertors
- Built-in 404/405 responses are content-negotiated: JSON clients get
{"error": ...} bodies
Fixes:
- OpenAPI paths no longer leak convertor patterns (/users/{id:int} ->
/users/{id})
- Duplicate route registration raises ValueError instead of an assert
that disappears under python -O
- Removed dead _exception_handlers bookkeeping
Quality:
- mypy: 25 errors -> 0 (proper signatures, BaseRoute interface,
input validation; no blanket ignores)
- ruff: 11 findings -> 0, with per-file ignores codified in pyproject
- types-pyyaml added to the test extra
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
246 B
246 B
Backlog
Future Ideas
- Pluggable rate limiter backends (e.g. Redis) for multi-process deployments
- OpenAPI: document path parameters from docstring operations' types when present
- First-class API client generation from the OpenAPI schema