INNER CODE UNIT · Python

stub

JasperSui/fastapi-injectable · src/fastapi_injectable/main.py:115

    def stub() -> None: ...  # pragma: no cover

    stub.__signature__ = sig.replace(parameters=dep_params)  # type: ignore[attr-defined]
    # get_dependant inspects annotations from __annotations__ as well in some FastAPI versions
    stub.__annotations__ = {p.name: p.annotation for p in dep_params}
    # Preserve identity for error messages and diagnostics
    stub.__name__ = getattr(func, "__name__", "stub")
    stub.__qualname__ = getattr(func, "__qualname__", "stub")
    return stub


async def resolve_dependencies(
    func: Callable[P, T] | Callable[P, Awaitable[T]],
    *,
    use_cache: bool = True,
    provided_kwargs: dict[str, Any] | None = None,
) -> dict[str, Any]:
    """Resolve dependencies for the given function using FastAPI's dependency injection system.

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…