From aded51c14b3423eae41476e92cbc2095eefb02f3 Mon Sep 17 00:00:00 2001 From: Abdessalam ZAIMI Date: Wed, 4 Nov 2026 20:45:03 +0100 Subject: [PATCH] fix: resolve Context() injections from the broker context FastStream sets the per-message values (message, ...) on the broker's context, so Context() injections such as `message: RabbitMessage` resolved to EmptyPlaceholder. Fixes #8 --- src/faststream_fastapi/faststream_api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/faststream_fastapi/faststream_api.py b/src/faststream_fastapi/faststream_api.py index 5746aff..08cc5fd 100644 --- a/src/faststream_fastapi/faststream_api.py +++ b/src/faststream_fastapi/faststream_api.py @@ -101,7 +101,7 @@ def __init__( subscriber._call_decorators = ( _subscriber_compatibility_wrapper( config=self._config, - context=self._startable_application.context, + context=broker.context, dependencies=dependencies, # type: ignore[arg-type] ), *subscriber._call_decorators,