| Name | Modified | Size | Downloads / Week |
|---|---|---|---|
| Parent folder | |||
| README.md | 2026-07-12 | 2.2 kB | |
| v9.1.0 source code.tar.gz | 2026-07-12 | 4.9 MB | |
| v9.1.0 source code.zip | 2026-07-12 | 5.0 MB | |
| Totals: 3 Items | 10.0 MB | 0 | |
Responder 9.1 makes Python return annotations complete HTTP response contracts, from runtime validation through OpenAPI and generated clients.
Added
- Return annotations are now complete response contracts. Any supported
Pydantic
TypeAdaptershape — models, dataclasses, typed dictionaries, collections such aslist[Item], unions, generic pagination models, and JSON scalars — drives runtime validation and serialization, OpenAPI response schemas, and generated-client types. Class-based-view method annotations and Flask-style tuple annotations infer the same way. Inferredstrandbytesresponses document and emittext/plainandapplication/octet-stream; other inferred contracts useapplication/json. - Handlers may return
bool,int, andfloatJSON scalars directly, in addition to the existing dictionaries, lists, strings, bytes, models, and dataclasses. responses={404: ErrorModel}now declares a status-specific response contract used for runtime validation and OpenAPI, including alternate success statuses. A response mapping may providemodelalongside a custom description, headers, examples, or other OpenAPI metadata.
Changed
- Response contracts now validate the final success body after after-request
hooks. A body whose shape or response channel contradicts its declared model
fails closed with
500, including a list returned for a single-object model;response_model=Falsereliably disables inference and validation. - Flask-style return tuples now require exactly
(body, status)or(body, status, headers), a status integer from 100 through 599, and a header mapping. Malformed tuples fail clearly instead of being partially applied or silently ignored. - Routes with unresolved or unsupported return annotations now log a focused
registration warning with the
response_model=Falseopt-out instead of silently dropping the inferred contract.
Fixed
- Informational,
204,205, and304responses no longer send a body even if a handler returned or assigned one. Their inferred OpenAPI success responses omit content as well;HEADcontinues to validate the correspondingGETresponse while sending headers only.