async def METHOD_NAME(*args, request: Request, **kwargs):
    # Replicate FastAPI behavior of auto-creating a context manager
    if inspect.isasyncgenfunction(dependency):
        context_manager = asynccontextmanager(dependency)
    else:
        context_manager = dependency
    # Ensure request is provided if requested
    if "request" in signature.parameters:
        kwargs["request"] = request
    # Enter the route handler provided stack that is closed before responding,
    # return the value yielded by the wrapped dependency
    return await request.state.response_scoped_stack.enter_async_context(
        context_manager(*args, **kwargs)
    )