Repository navigation
Conversation
…njector An argument of an API method, an interceptor or an exception handler is mapped from the request by Winter's own resolvers (path, query, body, headers, page position) or comes from the injector of the request, a child of the application's injector created for each request. Its type must be bound explicitly; otherwise the URL patterns fail on startup. @winter.web.request_scope marks a provider whose value is created once per request. Custom argument resolvers, the Django HttpRequest resolver and the response_headers argument of exception handlers are gone. Application no longer installs its injector globally. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 26, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #344.
What
pre_handleor an exception handler is either mapped from the request by Winter's fixed resolvers (path, query,@query_parameters,@request_body,@request_header,ResponseHeader[T],PagePosition) or taken from the injector of the request.handle_request. It bindswinter.web.Requestand what the adapter gives (the Django adapter:django.http.HttpRequest).@winter.web.request_scopemarks a provider whose value is created once per request; outside a request it raisesLookupError.create_urlsfails withTypeError(interceptors registered after that fail on the request). An auto-created object is not enough: a forgotten@request_bodywould become an empty object.Applicationno longer callsset_injector.Removed
ArgumentResolver,ArgumentsResolver,arguments_resolver,RequestBodyArgumentResolver,ResponseHeaderArgumentResolver,winter.web.pagination.PagePositionArgumentResolver,winter.django.HttpRequestArgumentResolver. A resolver of a type becomes a provider of that type marked@winter.web.request_scope.response_headersargument of exception handlers: they declareResponseHeader[T]with@winter.web.response_header, as API methods do.Tests
tests/test_application_scope.py: one API in two applications gets its argument from the injector of each.tests/web/test_request_scope.py: one value per request, shared by the interceptor and the API method; startup failures.🤖 Generated with Claude Code