Skip to content

Commit d58e83d

Browse files
committed
Added ctx, context for endpoint signature
1 parent 765108c commit d58e83d

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

ellar/core/params/args.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,16 @@ def compute_route_parameter_list(
224224
self._computation_models[websocket_inject.in_].append(websocket_inject)
225225
continue
226226

227+
if (
228+
param_name == ("context", "ctx")
229+
and param.default == inspect.Parameter.empty
230+
):
231+
context_inject = ParameterInjectable()(
232+
param_name, t.cast(t.Type, IExecutionContext)
233+
)
234+
self._computation_models[context_inject.in_].append(context_inject)
235+
continue
236+
227237
if self._add_non_field_param_to_dependency(
228238
param_name=param.name,
229239
param_default=param.default,

0 commit comments

Comments
 (0)