pypi / fastapi
fastapi
What changed in fastapi 0.119 to 0.165, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-30.
32 breaking1 security5 deprecations32 new APIs and options2 performance11 behavior and defaults2 tooling79 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initfastapi 0.1651 changes
New APIs and options 1
Form parsing limits are now configurable, allowing developers to adjust limits for form parsing.
fastapi 0.1641 changes
New APIs and options 1
Request body size limits are configurable, allowing developers to limit incoming request bodies.
fastapi 0.1632 changes
New APIs and options 1
Add dependency concurrency limits with the max_concurrency parameter.
Fixes and other changes 1
Fixes OpenAPI generation for response models with nested computed fields.
fastapi 0.1628 changes
Breaking changes 3
Support for Python 3.10 was dropped.
FastAPI now requires AnyIO 4.1.0 or newer at runtime.
Omitted boolean form fields now use declared defaults or produce missing-field errors instead of being inferred as False; unset model fields stay excluded from model_dump(exclude_unset=True), and defaults do not count as submitted fields during union selection.
Tooling 2
Install FastAPI’s official skill for coding agents in your project with this command.
Install the official FastAPI skill in your project to help coding agents use features and recommended patterns for the installed version.
Fixes and other changes 3
Fixes cleanup of async yield dependencies when cancellation occurs.
Fixes synchronous dependency cleanup when cancellation occurs.
FastAPI adds support for Python 3.15.
fastapi 0.1612 changes
New APIs and options 1
FastAPI now supports combining unions of form models.
Fixes and other changes 1
Fixes OpenAPI schemas for standalone nullable form unions.
fastapi 0.1601 changes
Breaking changes 1
Parameter models now apply their extra configuration to all submitted fields in the same parameter location, including sibling fields declared elsewhere.
fastapi 0.1594 changes
New APIs and options 4
Form models can now use optional unions.
Cookie parameters can now use optional parameter models.
Header parameters can now use optional parameter models.
Query parameters can now use optional parameter models.
fastapi 0.1583 changes
New APIs and options 2
Adds support for optional form models.
Form models can now be combined.
Fixes and other changes 1
Form media types are preserved in OpenAPI.
fastapi 0.1571 changes
New APIs and options 1
Query, header, and cookie parameter models can now be combined.
fastapi 0.15610 changes
Fixes and other changes 10
Converting an uploaded file to bytes now preserves its position.
Fixes validation error locations for form and file AliasChoices.
Query, header, and cookie parameters now respect model alias settings.
Fixed AliasChoices for path parameters.
Fixes AliasChoices handling for named JSON body parameters.
Fixes AliasChoices extraction for form models.
Fixed AliasChoices for query parameters, headers, and cookies.
Preserves Pydantic field metadata in inferred request parameters.
Preserves Pydantic field metadata when request options are omitted.
Preserves Pydantic Field attributes in request parameters.
fastapi 0.1551 changes
Breaking changes 1
Removed deprecated **extra keyword arguments from Path, Query, Header, Cookie, Body, Form, and File; unknown keyword arguments now raise TypeError. Use json_schema_extra for additional JSON Schema properties.
fastapi 0.1541 changes
New APIs and options 1
Adds Pydantic validation options to request parameters.
fastapi 0.1531 changes
Breaking changes 1
Unions of form models now use browser form handling: empty scalar fields use defaults or produce missing-field errors, empty list items are preserved, omitted booleans become False, and unselected files are treated as missing. JSON request bodies are unchanged.
fastapi 0.1521 changes
Behavior and default changes 1
Validation errors for header parameter models now report HTTP header names instead of Python field names; explicit aliases and the documented settings retain their existing behavior.
fastapi 0.1511 changes
Breaking changes 1
Explicit null is validated as None rather than treated as omission; defaults apply only when a value is omitted, and null for an expected JSON object body returns a validation error.
fastapi 0.1501 changes
Breaking changes 1
Unselected browser file inputs are treated as missing: required file fields return a validation error, defaults are used, and unselected inputs are ignored in file lists.
fastapi 0.1491 changes
Breaking changes 1
Empty scalar values in form models are treated as missing. Required fields return a validation error; defaults and default factories apply, and fields remain unset in model_dump(exclude_unset=True). Empty strings in lists, omitted boolean fields, JSON requests, and direct Pydantic validation…
fastapi 0.1485 changes
Breaking changes 3
For parameter models, applying a default no longer marks a field as explicitly set, so model_dump(exclude_unset=True) excludes it.
Defaults for omitted Query, Header, Cookie, and Form parameters and model fields are no longer treated as user input or validated by default. Enable validate_default=True when omitted values should be validated.
Validation errors no longer include injected defaults in input.
Fixes and other changes 2
Body(validate_default=True) is now honored, allowing validation of default values.
Default factories run once.
fastapi 0.1471 changes
Breaking changes 1
Omitted bool and bool | None form fields are interpreted as False, including required fields and fields defaulting to True or None; the inferred value counts as explicitly set.
fastapi 0.1461 changes
Deprecations 1
The root_path parameter is deprecated; configure the server with fastapi run --root-path /api/v1 instead.
fastapi 0.1452 changes
Breaking changes 2
The unused **extra parameter was removed from FastAPI.
The deprecated openapi_prefix parameter was removed from FastAPI.
fastapi 0.1441 changes
New APIs and options 1
Security dependencies can now be used with WebSocket endpoints.
fastapi 0.1437 changes
Breaking changes 2
Set this environment variable to true to retain automatic OpenTelemetry exporter setup from OTEL_* environment variables.
Set auto_configure to true in the FastAPI telemetry configuration to retain automatic OpenTelemetry exporter setup.
New APIs and options 1
Added httpx2 to the optional dependencies.
Fixes and other changes 4
Fixes handling of an empty value for the byte file list parameter.
Fixes serialization of non-finite floats in JSONL and SSE streams.
Fixes blocking frontend fallback file checks.
Fixes included route metadata in iter_route_contexts().
fastapi 0.1425 changes
New APIs and options 1
FastAPI adds native OpenTelemetry support.
Fixes and other changes 4
FastAPI telemetry is isolated for excluded requests.
Cache OpenTelemetry tracers to preserve warning deduplication.
Startup is allowed to continue when automatic OpenTelemetry configuration fails.
Fixes repeated endpoint wrapping in included routers.
fastapi 0.1412 changes
New APIs and options 1
Adds app.frontend with check_dir="auto" to make local development more convenient with fastapi dev.
Fixes and other changes 1
Fix support for background tasks and headers from dependencies in
app.frontend().
fastapi 0.1407 changes
Performance 1
Reduced memory usage in dependencies, which may lower FastAPI’s runtime memory consumption.
Fixes and other changes 6
Fixes
status_codebeing ignored for SSE and JSONL streaming endpoints.Fixes line splitting to comply with the SSE spec.
Fixes response_model_* parameters being ignored for non-generator endpoints with Iterable return types.
Fix handling sequences with nested Annotated types.
Fixes
exclude_defaultsnot being propagated to dictionary keys and values during encoding.Fixes the stream item type being lost when using include_router().
fastapi 0.1393 changes
New APIs and options 1
app.frontend() now supports dependencies, for example to enable automatic cookie authentication for the frontend.
Fixes and other changes 2
Router route building is thread-safe, mainly benefiting tests running in parallel threads.
Frontend fallback now supports dotted paths such as /users/john.doe.
fastapi 0.1383 changes
Breaking changes 1
Returns 404 for methods other than GET or HEAD when there are no static file matches.
New APIs and options 2
Adds support for serving a frontend from a directory using app.frontend, allowing developers to configure the frontend at a path such as /.
Adds support for serving a frontend from a directory using router.frontend, allowing developers to configure the frontend at a path such as /.
fastapi 0.1378 changes
Breaking changes 1
router.routes can now contain intermediate objects forming a tree, not just APIRoute objects; treat it as an internal implementation detail rather than iterating or modifying it as a flat list.
New APIs and options 3
Adds iter_route_contexts() for advanced use cases that previously used router.routes.
APIRouter adds an experimental handle method, allowing a router to customize how it handles requests.
APIRouter adds an experimental matches method, allowing a router to customize how it matches requests, such as matching on a specific header.
Behavior and default changes 2
APIRouter instances are preserved when included instead of having their routes copied, enabling router customization and saving memory in some cases.
Included routers and routes are no longer copied, so routes added after inclusion are reflected, and a subrouter can be included before its routes are added.
Fixes and other changes 2
Typing checks for APIRoute are fixed.
Path operations in a prefixless router now allow an empty path.
fastapi 0.1363 changes
Breaking changes 1
With the default convert_underscores=True, underscore headers are no longer accepted.
Fixes and other changes 2
Server Sent Event fields are validated to prevent applications from sending broken data.
FastAPI supports free-threaded Python 3.14t.
fastapi 0.1359 changes
Breaking changes 2
The April Fool's @app.vibe() decorator was removed.
The minimum supported Pydantic version is now 2.9.0, affecting which versions can be installed with FastAPI.
New APIs and options 5
Adds support for the @app.vibe() decorator.
Use EventSourceResponse as a path operation's response_class to stream Server-Sent Events.
FastAPI supports streaming SSE from async or regular generator path operations; yielded items are JSON-encoded, and declared return types enable Pydantic validation, documentation, and serialization.
FastAPI adds support for Server-Sent Events (SSE).
Yield ServerSentEvent objects to set SSE fields such as data, event, id, retry, comment, or raw_data.
Behavior and default changes 1
SSE streams send a keep-alive ping comment every 15 seconds without a message and set headers to prevent caching and proxy buffering.
Fixes and other changes 1
Avoids yielding from a TaskGroup; it is used only as an async context manager and closed in the request async exit stack.
fastapi 0.1341 changes
New APIs and options 1
Endpoints can stream JSON Lines and binary data with yield.
fastapi 0.1332 changes
New APIs and options 1
Adds a FastAPI Agent Skill for use with library agent skills.
Behavior and default changes 1
FastAPI now supports Starlette 1.0.0 and later.
fastapi 0.1321 changes
Breaking changes 1
FastAPI now rejects JSON requests without a valid JSON Content-Type header by default; set strict_content_type=False to disable the check.
fastapi 0.1312 changes
Deprecations 2
ORJSONResponse is deprecated.
UJSONResponse is deprecated.
fastapi 0.1301 changes
Performance 1
JSON responses are serialized with Pydantic in Rust when there is a Pydantic return type or response model, resulting in a 2x or greater performance increase.
fastapi 0.1293 changes
Breaking changes 2
Support for fastapi-slim is dropped and no further versions will be released; use fastapi[standard] or fastapi instead.
FastAPI no longer supports Python 3.9, so developers must use a supported Python version.
Fixes and other changes 1
The JSON Schema for bytes uses contentMediaType: application/octet-stream instead of format: binary.
fastapi 0.12816 changes
Breaking changes 1
Support for pydantic.v1 has been dropped.
Deprecations 1
fastapi-slim is deprecated; its build setup is changed so it only depends on fastapi.
New APIs and options 1
FastAPI supports PEP 695 TypeAliasType.
Behavior and default changes 3
HTTPException.headers now uses Mapping instead of dict, allowing mappings as header values.
Response type hints can now be used as dependency annotations.
Updates the ValidationError schema to include
inputandctx.
Fixes and other changes 10
Attempting to include a router into itself now produces a clear error.
Fixes the on_shutdown parameter of APIRouter.
Fixes the on_startup parameter of APIRouter.
Re-implemented for compatibility with the next Starlette while keeping backwards compatibility.
Fixes support for using Json[list[str]] as a type.
Strips whitespace from credentials in the Authorization header.
Fixes duplicated anyOf refs for app-level responses with specified content and a Union model.
Fixes TYPE_CHECKING annotations for Python 3.14 (PEP 649).
Improves the error message shown for invalid query parameter type annotations.
Adds a viewport meta tag to improve Swagger UI on mobile devices.
fastapi 0.1272 changes
Deprecations 1
Using pydantic.v1 now emits deprecation warnings.
New APIs and options 1
Adds a custom deprecation warning category, allowing developers to identify FastAPI deprecation warnings.
fastapi 0.1264 changes
Breaking changes 4
The standard dependencies now include pydantic-extra-types version 2.0.0 or later.
The standard dependencies now include pydantic-settings version 2.0.0 or later.
FastAPI drops support for Pydantic v1, while retaining short temporary support for Pydantic v2's pydantic.v1.
The minimum installed Pydantic version is now 2.7.0.
fastapi 0.1251 changes
Breaking changes 1
FastAPI no longer supports Python 3.8; installers on Python 3.8 will refuse the latest version and install 0.124.4 instead.
fastapi 0.1245 changes
Behavior and default changes 1
Tracebacks include endpoint metadata to improve debugging.
Fixes and other changes 4
Fixes parameter aliases.
Fixes support for a tagged union whose discriminator is inside Annotated with Body().
Fixes support for non-evaluated stringified annotations under if TYPE_CHECKING.
Fix handling arbitrary types when arbitrary_types_allowed=True.
fastapi 0.12319 changes
Behavior and default changes 1
Dependables can now be used with functools.partial().
Fixes and other changes 18
Fix using a dependency class, rather than an instance, when the class has a __call__ method.
Fixes OAuth2 scopes in OpenAPI for corner cases involving parent dependencies with scopes and sub-dependency security schemes without scopes.
Fixes OAuth2 scopes declarations and deduplicates security schemes with different scopes in the generated OpenAPI schema.
Fixed evaluating stringified annotations in Python 3.10.
Support combining functools wraps and partial for async and regular functions and classes in path operations and dependencies.
Wrapped functions used with forward references are now supported.
Optional sequences using Python 3.10's new union syntax are now handled correctly.
Wrapped dependencies are now handled.
Fix the behavior of
separate_input_output_schemas=Falsewhen used withcomputed_field.Fixes optional sequence handling when serializing sequence values with Pydantic V2.
Fixes the alias for Query, Header, and Cookie parameter models.
Fixes parsing of extra non-body parameter lists.
Fixes unformatted {type_} in FastAPIError messages.
Fixes parsing of extra Form parameter lists.
Form values with empty strings are no longer interpreted as missing (None if that's the default), improving compatibility with HTML forms.
Fixes a TypeError when encoding a decimal with a NaN or Infinity value.
Avoids accessing a non-existing "$ref" key during Pydantic v2 compatibility remapping.
Fixes caching dependencies that don't use scopes and don't have sub-dependencies with scopes.
fastapi 0.1222 changes
Breaking changes 1
Security classes now return 401 when credentials are missing instead of 403; override the classes if you need the previous behavior.
Security 1
Fixes hierarchical security scope propagation.
fastapi 0.1215 changes
New APIs and options 1
Adds dependency scopes, including scope="request" for yield dependencies that exit before the response is sent.
Behavior and default changes 1
Results of Depends() are now hashable, as a workaround for other tools interacting with these internal parts.
Fixes and other changes 3
Results of Security() are now hashable, as a workaround for other tools interacting with these internal parts.
Fixes handling of JSON Schema attributes named "$ref".
Fixes Depends with scope='function' for top-level parameterless dependencies.
fastapi 0.1202 changes
Fixes and other changes 2
Fixes security schemes in OpenAPI when they are added at the top level app.
Fixes separation of schemas with nested models that was introduced in 0.119.0.
fastapi 0.1191 changes
Fixes and other changes 1
Fixes internal Pydantic v1 compatibility warnings for Python 3.14 and Pydantic 2.12.1.