Skip to content

get_fastapi_native_dependant

faststream.broker.fastapi.get_dependant.get_fastapi_native_dependant #

get_fastapi_native_dependant(orig_call, dependencies)

Generate native FastAPI Dependant.

Source code in faststream/broker/fastapi/get_dependant.py
def get_fastapi_native_dependant(
    orig_call: Callable[..., Any],
    dependencies: Iterable["params.Depends"],
) -> Any:
    """Generate native FastAPI Dependant."""
    dependent = get_dependant(
        path="",
        call=orig_call,
    )

    for depends in list(dependencies)[::-1]:
        dependent.dependencies.insert(
            0,
            get_parameterless_sub_dependant(depends=depends, path=""),
        )

    return dependent