File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change 1414 Sequence ,
1515 Tuple ,
1616 Type ,
17+ TypeVar ,
1718 Union ,
1819 cast ,
1920 overload ,
@@ -517,13 +518,16 @@ def api_controller(
517518 ...
518519
519520
521+ InputClassType = TypeVar ("InputClassType" , bound = ControllerBase )
522+
523+
520524def api_controller (
521525 prefix_or_class : Union [str , Type ] = "" ,
522526 auth : Any = NOT_SET ,
523527 tags : Union [Optional [List [str ]], str ] = None ,
524528 permissions : Optional ["PermissionType" ] = None ,
525529 auto_import : bool = True ,
526- ) -> Union [Type [ControllerBase ], Callable [[Type ], Type [ControllerBase ]]]:
530+ ) -> Union [Type [ControllerBase ], Callable [[InputClassType ], Type [InputClassType ]]]:
527531 if isinstance (prefix_or_class , type ):
528532 return APIController (
529533 prefix = "" ,
@@ -533,7 +537,7 @@ def api_controller(
533537 auto_import = auto_import ,
534538 )(prefix_or_class )
535539
536- def _decorator (cls : Type ) -> Type [ControllerBase ]:
540+ def _decorator (cls : InputClassType ) -> Type [InputClassType ]:
537541 return APIController (
538542 prefix = str (prefix_or_class ),
539543 auth = auth ,
You can’t perform that action at this time.
0 commit comments