Skip to content

The transports compared

One spec is declared once and served by any of five distributions over this kernel: django-spec-rest (DRF), django-spec-html (pages and plain-Django JSON views), django-spec-cli (management commands), django-spec-mcp (MCP tools) and django-spec-agents (Pydantic AI tools). Only django-spec-rest imports DRF.

They run the same dispatch, but what each one does around it differs. This page lists the differences a spec author can notice; the linked page owns each behaviour.

Behaviour REST HTML CLI MCP Agents
An argument no parameter declares Ignored Selector pages ignore a query key; the JSON views refuse it Refused: there is no such option Refused, unless the tool is registered to ignore Refused, unless the toolset is built to ignore
A permission check refuses 403; DRF's not-authenticated answer when no one authenticated 403 Exit code 4 JSON-RPC error -32006 under HTTP 403 The run ends, unless reraise leaves the denial out
A route capture the spec does not declare Not sent as an argument ImproperlyConfigured on the request, unless route_kwargs drops it No routes No routes No routes
PATCH over a Validator with supports_partial = False Validates every field, as PUT does The method changes nothing: the spec's partial decides No methods No methods No methods
A choice in the output The stored value JSON views: the stored value. A page's target_display and row_displays: the display, through spoken_choices JSON Lines: the stored value; a table: the display The stored value; the output schema carries the display as its title The stored value; the return schema carries the display as its title
A description of the operation, from its docstring n/a n/a --help shows the first paragraph No fallback: pass description= Falls back to the docstring when descriptions names none
view in the call context The DRF view The Django view None None The run's call_context entry, else None
A read beside an untyped kwargs provider Optional in a write's OpenAPI and OPTIONS schemas Not demanded by dispatch An optional option Optional in the input schema Optional in the tool's schema

Notes

  • Choices on pages. project_payload keeps the stored value, so a page shows the display only where the transport calls spoken_choices. A django-spec-html release that does not call it yet shows the stored value.
  • Return schemas. A Pydantic AI model is not sent a tool's return schema by default, so django-spec-agents shows it the display only on a toolset that includes return schemas.
  • Descriptions. spec_description reads a spec's docstring for a transport that wants it. The rows above are each transport's own reading.
  • view. A seed named view supplies what a callable's view parameter is handed and leaves the call context as it was (see CALL_SEEDS). django-spec-agents refuses one among its pool_seeds and takes it from call_seeds.
  • Untyped providers. The reach is the kernel's, so it holds for every transport. Building such a spec warns with UntypedProviderWarning.