fastapi/fastapi
Lore
A timeline of the FastAPI codebase, derived from git history (git log since the first commit on 5 December 2018).
Eras
Genesis (Dec 2018 – mid 2019)
The first commit landed on 5 December 2018 by Sebastián Ramírez (tiangolo). The framework was a single-author project: 2,193 commits in 2019 alone, almost all by the original author. The initial design choices already in place — Starlette as the ASGI core, Pydantic v1 for validation, a decorator-driven path-operation API, automatic OpenAPI generation, and a bundled Swagger UI — have not changed in seven years.
Stabilisation and ecosystem (2020 – 2021)
Activity slowed in calendar terms (725 commits in 2020, 482 in 2021) but the API surface stabilised. The Annotated[...] parameter style was added during this stretch; deprecated parameters (regex=, Form and File quirks) gained their deprecated() markers. The repo grew translation infrastructure (docs/<lang>/...), a translations workflow under .github/workflows/notify-translations.yml, and the scripts/people.py automation that rebuilds the contributor pages.
Pydantic v2 migration (mid 2023 – 2024)
The largest single technical change in the project. Pydantic 2 shipped with a different API for fields, validators, and JSON-schema generation, and FastAPI maintained both v1 and v2 paths through fastapi/_compat/v1.py and fastapi/_compat/v2.py for over a year. The compatibility module is still there (see fastapi/_compat/__init__.py and fastapi/_compat/v2.py), but Pydantic v1 support has now been removed — fastapi/utils.py:create_model_field raises PydanticV1NotSupportedError if a v1 model is encountered, and fastapi/exceptions.py defines that error class.
Tooling expansion (2024)
2024 was the busiest year on record at 1,999 commits, much of it from github-actions[bot] and dependabot[bot] (see By the numbers). Concrete additions visible in the tree:
- The
tytype checker (Astral) added alongsidemypy— seescripts/lint.sh. prekreplacespre-commitas the default runner.playwrightandzizmorjoin thedevdependency group (pyproject.toml).- The
fastapi-cliextraction completed —fastapi/cli.pyis now a five-line shim that imports from the separatefastapi-clipackage. - Translation automation grew an LLM-driven helper at
scripts/translate.py, usingpydantic-ai.
Modern feature additions (2025 – 2026)
Recent commits show the framework picking up first-class Server-Sent Events support — fastapi/sse.py exposes EventSourceResponse, ServerSentEvent, and format_sse_event() with the OpenAPI 3.2 SSE schema baked in (see the _SSE_EVENT_SCHEMA constant). The routing layer now keeps a per-endpoint context cache (_endpoint_context_cache in fastapi/routing.py) so validation errors can quote a path, function name, file, and line number. EndpointContext, DependencyScopeError, and the scope: Literal["function", "request"] field on Dependant were all added during this stretch.
The latest commit on master (d8a2c1eda, 30 April 2026) is 📝 Update release notes, made by github-actions[bot]. Recent feature PRs include 15462 (layout polish), 15458 (interactive tabs in the opinions section), and 15457 (FastAPI Conf '26 announcement).
Longest-standing code
fastapi/__init__.py, fastapi/applications.py, and fastapi/routing.py all date from the very first commit (2018-12-05). They have been refactored heavily but never replaced — the public-API exports in __init__.py (FastAPI, APIRouter, Depends, HTTPException, Body, Query, Path, Cookie, Header, File, Form, Security, Request, Response, WebSocket, …) have been stable for the lifetime of the project. The BackgroundTasks re-export from fastapi/background.py is similarly original.
Deprecated features still visible in tree
UJSONResponseandORJSONResponseinfastapi/responses.pyare explicitly deprecated; the framework now serializes through Pydantic.- The
regex=parameter onPath/Query/Header/Cookie/Bodyis deprecated in favour ofpattern=(seeParam.__init__infastapi/params.py). fastapi.utils.generate_operation_id_for_pathis deprecated and unused internally;generate_unique_idreplaced it.on_startup/on_shutdownare kept for compatibility via the vendored_DefaultLifespaninfastapi/routing.py. Starlette removed its own copy; FastAPI re-vendored the class to maintain backwards compatibility (referenced in a comment to Starlette PR #3117).pydantic.v1model support: removed.PydanticV1NotSupportedError(fastapi/exceptions.py) is now raised at model-creation time.
Major rewrites
- Pydantic v2 migration — see era above.
fastapi-cliextraction — the top-levelfastapicommand moved into the standalonefastapi-clipackage;fastapi/cli.pyshrank to a five-line wrapper.fastapi-slimdistribution — thefastapi-slim/directory hosts an alternate PyPI distribution built from the same sources, exercised by.github/workflows/test-redistribute.yml.
Growth trajectory
xychart-beta
title "Commits per year"
x-axis ["2019", "2020", "2021", "2022", "2023", "2024", "2025", "2026 YTD"]
y-axis "Commits"
bar [2193, 725, 482, 665, 780, 1999, 1144, 597]The framework was hyperactive in its first year, settled into 500–800 commits/year through 2020-2023, then accelerated again from 2024 onward — a mix of human contributions and the bot-driven release/translation/dependency cadence described in By the numbers.
Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.
Previous
By the numbers
Next
Fun facts