Download Latest Version v9.2.0 source code.zip (5.0 MB)
Email in envelope

Get an email when there's a new version of Responder

Home / v9.1.0
Name Modified Size InfoDownloads / 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 TypeAdapter shape — models, dataclasses, typed dictionaries, collections such as list[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. Inferred str and bytes responses document and emit text/plain and application/octet-stream; other inferred contracts use application/json.
  • Handlers may return bool, int, and float JSON 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 provide model alongside 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=False reliably 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=False opt-out instead of silently dropping the inferred contract.

Fixed

  • Informational, 204, 205, and 304 responses no longer send a body even if a handler returned or assigned one. Their inferred OpenAPI success responses omit content as well; HEAD continues to validate the corresponding GET response while sending headers only.
Source: README.md, updated 2026-07-12