def set_values(
     param1: int,
     d1: ServiceOne = Depends(ServiceOne),
     d2: MyMainClass = Depends(MyMainClass),
     d3: AnotherMainClass = Depends(AnotherMainClass),
 ) -> None:
     ...
예제 #2
0
 def my_function(dependency: Dependency = Depends(Dependency)):
     return dependency.x
예제 #3
0
 def my_function(p1: int,
                 p2: int,
                 p3: int,
                 p4: int,
                 dep: Dependency = Depends(Dependency)) -> int:
     return p1 + p2 + dep.x + p3 + p4
예제 #4
0
 def function(d: Dependency = Depends(Dependency)):
     ...
예제 #5
0
 def my_function(
     value: int, dependency: Dependency = Depends(Dependency)) -> int:
     return value + dependency.x