Upgrading fastapi 0.105 to 0.106
Breaking0.105.0 → 0.106.0Breaking1New1Changed1
BreakingUpgrade verdict
1 breaking change.
In plain terms
- If a background task relied on objects created by a dependency that uses yield, such as a database connection, that no longer works. Background tasks must create their own resources.
Must act 1 item needs code or config changes
What you must change
Breaking1
Removes support for using resources from dependencies with yield inside background tasks.
yieldAPI changes
Generated by DepDelta from published Python source. Not mixed with prose notes.
- removed:
method FastAPI.build_middleware_stack() -> ASGIApp
- changed:
async function solve_dependencies(*, request: Union[Request, WebSocket], dependant: Dependant, body: Optional[Union[Dict[str, Any], FormData]]=…, background_tasks: Optional[StarletteBackgroundTasks]=…, response: Optional[Response]=…, dependency_overrides_provider: Optional[Any]=…, dependency_cache: Optional[Dict[Tuple[Callable[..., Any], Tuple[str]], Any]]=…) -> Tuple[Dict[str, Any], List[Any], O… → async function solve_dependencies(*, request: Union[Request, WebSocket], dependant: Dependant, body: Optional[Union[Dict[str, Any], FormData]]=…, background_tasks: Optional[StarletteBackgroundTasks]=…, response: Optional[Response]=…, dependency_overrides_provider: Optional[Any]=…, dependency_cache: Optional[Dict[Tuple[Callable[..., Any], Tuple[str]], Any]]=…, async_exit_stack: AsyncExitStack) ->…
- removed:
class AsyncExitStackMiddleware - removed:
constructor AsyncExitStackMiddleware(app: ASGIApp, context_name: str=…) -> None