FastAPI
Frontend & MobileFastAPI framework, high performance, easy to learn, fast to code, ready for production
Release History
View all versions →0.141.11 fixThis release fixes an issue with background tasks and headers in `app.frontend()`. Documentation for `FASTAPI_ENV` in the FastAPI CLI guide has also been updated.
0.141.01 featureIntroduces a new `check_dir="auto"` option for `app.frontend` to simplify local development with `fastapi dev`. This enhancement aims to improve developer convenience.
0.140.131 fixThis release includes a fix for `status_code` being ignored in SSE and JSONL streaming endpoints. It also contains documentation improvements for `format_sse_event` and the addition of an API reference page for `fastapi.sse`.
0.140.121 fixThis release fixes an issue with line splitting in `format_sse_event` to ensure compliance with the Server-Sent Events (SSE) specification.
0.140.111 fixThis release fixes a bug where `response_model_*` parameters were ignored for certain non-generator endpoints. The fix ensures correct behavior for endpoints returning `Iterable[...]`.
0.140.101 fixThis release includes a fix for handling sequences with nested Annotated types. It also contains several internal improvements related to testing and regression checks.
0.140.91 fixThis release includes a fix for `exclude_defaults` in `jsonable_encoder` and several internal dependency updates.
0.140.81 fixThis release fixes a bug where the stream item type was lost when using `include_router()`. The fix is detailed in PR #15077.
0.140.7This release includes refactoring to avoid flattening dependencies for OpenAPI and internal upgrades to latest-changes. It also adds benchmarks for OpenAPI dependency.
0.140.6This release refactors how dependencies are handled for request parameters, particularly for OpenAPI. This change aims to improve the management of complex parameter structures.
0.140.5This release includes a refactor to avoid flattening dependencies for body fields, as detailed in PR #16071.
0.140.4This release includes a refactor to skip unused dependency repeat bookkeeping, improving efficiency. The change is detailed in PR #16069.
0.140.3This release includes a refactor to avoid repeated dependency flattening in OpenAPI, improving performance. The change was implemented in PR #16067.
0.140.2This release includes refactoring to stop retaining flat dependency trees and the addition of a new memory benchmark for internal use.
0.140.1Updated the lru_cache limit for dependencies to better handle large applications. This refactor aims to improve performance and resource management in complex app scenarios.
0.140.01 fix1 featureThis release focuses on documentation improvements, including adding new library skills documentation and restructuring existing pages. It also includes refactors to reduce memory usage in dependencies and internal updates to CI benchmarks and data generation scripts.
0.139.21 fixThis release introduces a thread-safe refactor for router route building, improving stability for parallel test execution. The change is mainly relevant for less common testing scenarios.
0.139.11 fixThis release includes a fix for frontend fallback support with doted paths and numerous internal updates and dependency bumps. It also features extensive translation updates across multiple languages.
0.139.01 featureThis release introduces the ability to pass dependencies to app.frontend() for enhanced frontend integration, alongside numerous internationalization updates and internal maintenance.
0.138.21 fixThis release refactors the `app.frontend()` function to return a 404 for unsupported HTTP methods when no static files match. It also includes internal updates to sponsor data handling.
0.138.1This release focuses primarily on internal maintenance, including dependency updates and refactoring library skill information accessibility for agents.
0.138.01 fix1 featureThis release introduces the ability to serve frontend assets directly via `app.frontend()` and `router.frontend()`. It also includes numerous documentation improvements and internal maintenance updates.
0.137.21 fix1 featureThis release introduces the new iter_route_contexts() method for advanced routing introspection and includes numerous dependency updates and translation fixes.
0.137.12 fixesThis release focuses on bug fixes, specifically addressing typing checks for APIRoute and allowing empty paths in prefixless routers.
0.137.0Breaking5 featuresThis release refactors the internal handling of `APIRouter` inclusion to preserve route instances instead of cloning them, enabling new features like adding routes after inclusion. This change modifies the structure of `router.routes`, which is a breaking change for code relying on its previous list structure.
Common Errors
PydanticUserError2 reportsPydanticUserError in FastAPI often arises from incorrect type hinting involving Pydantic models, especially within dependencies or request body definitions. Resolve this by ensuring consistent and explicit type annotations: use `Annotated` correctly for dependencies with `Body()` and verify discriminated unions are properly defined and imported from `typing` instead of `collections`. Consider explicitly defining a Pydantic model schema when using complex types within request bodies.
ValidationError1 reportThe "ValidationError: field required (type=value_error.missing)" error usually means your FastAPI endpoint expects a specific field in the request body, but it's missing or wasn't properly sent in the request. To fix this, ensure your request body includes all the required fields as defined in your Pydantic model associated with the endpoint, and verify that the field names match exactly. Also, check that the Content-Type header in your request is set to "application/json" if you are sending a JSON payload.
NotImplementedError1 reportNotImplementedError in FastAPI often arises when a custom type lacks explicit handling for JSON serialization or schema generation, especially when `arbitrary_types_allowed=True`. To fix this, implement `__get_validators__` and `json_encoders` within your custom type to define how it is serialized and represented in the OpenAPI schema, or use a suitable pydantic field type for serialization. Ensure that pydantic can properly understand and serialize the custom type when generating the OpenAPI schema.
RequestValidationError1 reportThe "RequestValidationError" usually means your FastAPI endpoint expects data in the request body that is missing or doesn't match the expected schema. To fix this, carefully examine your pydantic model and ensure the incoming request includes all required fields with the correct data types. You can also use `Optional[]` for non-required fields in your Pydantic model.
Related Frontend & Mobile Packages
The library for web and native user interfaces.
Flutter makes it easy and fast to build beautiful apps for mobile and beyond
The React Framework
A framework for building native applications using React
:electron: Build cross-platform desktop apps with JavaScript, HTML, and CSS
Build smaller, faster, and more secure desktop and mobile applications with a web frontend.
Subscribe to Updates
Get notified when new versions are released