Skip to content

feat(openapi)!: fixed route parameter inspectors, @type_inspector, no initialization - #351

Open
mofr wants to merge 1 commit into
feat/native-response-typesfrom
feat/openapi
Open

mofr wants to merge 1 commit into
feat/native-response-typesfrom
feat/openapi

Conversation

@mofr

@mofr mofr commented Oct 27, 2026

Copy link
Copy Markdown
Collaborator

Stacked on #350.

What

  • The parameters of a route come from a fixed internal list of inspectors (path, query, PagePosition), mirroring the arguments that winter.web maps from the request since feat(web)!: resolve arguments from the request or the application's injector #345. Gone: register_route_parameters_inspector, get_route_parameters_inspectors, and the exports of RouteParametersInspector, the three inspectors and inspect_page. A parameter that no argument stands for, such as a header read by a request-scoped provider, is added to the spec that generate_openapi returns.
  • register_type_inspector becomes the decorator @winter.openapi.type_inspector(T), without the call form with func=. Type inspectors stay global, like JSON encoders: they describe a type and its subclasses wherever it appears, in a body, a response or a parameter.
  • register_global_exception is gone; @winter.openapi.global_exception remains as the only name of that annotation.
  • winter.openapi.initialization is gone. Its four marks of Winter's own exceptions as global no longer affected anything: the check of @raises looks at the definitions of the application only, where Winter's classes are not. Page was registered twice. All tests pass without them.
  • docs/architecture.md: OpenAPI type inspectors join the metadata that may be global; the deviations no longer list winter.openapi.

Why

The route parameter inspectors were the only behavioural registry of winter.openapi, and they describe what winter.web maps, which is now fixed. Decorators in Winter name what a thing is (@route_get, @problem, @global_exception); register_… named the mechanism.

To be confirmed on the consumer: whether it registers route parameter inspectors, subclasses RouteParametersInspector, or calls register_global_exception.

🤖 Generated with Claude Code

… initialization

The parameters of a route come from its path, query and PagePosition
arguments, mirroring the arguments winter.web maps from the request, so the
global list of route parameter inspectors and its registration are gone.
Type inspectors and @global_exception stay: they are metadata about types.
register_type_inspector becomes the decorator @type_inspector, and
register_global_exception is gone. winter.openapi.initialization is gone:
its marks of Winter's own exceptions as global no longer affected the check
of @raises, which looks at the application's definitions only, and Page
already had its inspector.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant