# Feature catalog — fastapi/fastapi

> Canonical page: https://codevetter.com/unpack/fastapi/feature-catalog

# Feature catalog — fastapi/fastapi

Scanned commit 50113da16fec53b66b80d75e80a89296de4fa5a5 (2026-09-01). Generated by codevetter codevetter 1.12.0 on 2026-09-22.

The user-facing feature set is the decorator API (`@app.get/put/post/delete/options/head/patch/trace`, `@app.websocket`, `@app.middleware`, `@app.exception_handler`), the parameter-declaration vocabulary (`Path`, `Query`, `Header`, `Cookie`, `Body`, `Form`, `File`, `Depends`, `Security`), the auto-generated OpenAPI 3.1 document plus Swagger UI and ReDoc pages, and seven built-in security schemes. This version adds three substantial features beyond classic FastAPI: Server-Sent Events via `response_class=EventSourceResponse`, JSON-Lines streaming from generator endpoints, and `app.frontend()` for serving built SPA assets as low-priority routes. Dependencies gained an explicit `scope` of `"function"` or `"request"`. Two response classes — `ORJSONResponse` and `UJSONResponse` — are now deprecated in favour of a Pydantic `dump_json` fast path.
- `FastAPI.setup()` registers up to four non-schema routes at construction: `openapi_url` (default `/openapi.json`), `docs_url` (`/docs`, Swagger UI), `swagger_ui_oauth2_redirect_url`, and `redoc_url` (`/redoc`); each is skipped when its URL is set to `None`. — [fastapi/applications.py#L1105-1158](https://github.com/fastapi/fastapi/blob/50113da16fec53b66b80d75e80a89296de4fa5a5/fastapi/applications.py#L1105-L1158)
- All eight HTTP verb decorators plus `api_route`, `add_api_route`, `websocket`, `add_api_websocket_route`, `websocket_route`, `on_event`, `middleware`, `exception_handler` and `include_router` are defined on `FastAPI` and mirrored on `APIRouter`. — [fastapi/applications.py#L1301-4780](https://github.com/fastapi/fastapi/blob/50113da16fec53b66b80d75e80a89296de4fa5a5/fastapi/applications.py#L1301-L4780) [fastapi/routing.py#L3133-3320](https://github.com/fastapi/fastapi/blob/50113da16fec53b66b80d75e80a89296de4fa5a5/fastapi/routing.py#L3133-L3320)
- Server-Sent Events: setting `response_class=EventSourceResponse` on a generator path operation makes the router encode each yielded item into SSE wire format via `format_sse_event`, set `Cache-Control: no-cache` and `X-Accel-Buffering: no`, and inject a `: ping` keepalive comment every `_PING_INTERVAL` (15s) of idleness. — [fastapi/sse.py#L20-33](https://github.com/fastapi/fastapi/blob/50113da16fec53b66b80d75e80a89296de4fa5a5/fastapi/sse.py#L20-L33) [fastapi/sse.py#L236-241](https://github.com/fastapi/fastapi/blob/50113da16fec53b66b80d75e80a89296de4fa5a5/fastapi/sse.py#L236-L241) [fastapi/routing.py#L519-627](https://github.com/fastapi/fastapi/blob/50113da16fec53b66b80d75e80a89296de4fa5a5/fastapi/routing.py#L519-L627)
- `ServerSentEvent` is a Pydantic model with `data`, `raw_data`, `event`, `id`, `retry`, `comment`; validators reject multi-line `event`/`id` values and null bytes in `id`, and a model validator forbids setting `data` and `raw_data` together. — [fastapi/sse.py#L36-157](https://github.com/fastapi/fastapi/blob/50113da16fec53b66b80d75e80a89296de4fa5a5/fastapi/sse.py#L36-L157)
- JSON-Lines streaming: when `is_json_stream` is set, generator endpoints are wrapped into a `StreamingResponse` with media type `application/jsonl`, each item serialized by `_serialize_data` and terminated with `\n`. — [fastapi/routing.py#L636-679](https://github.com/fastapi/fastapi/blob/50113da16fec53b66b80d75e80a89296de4fa5a5/fastapi/routing.py#L636-L679)
- `app.frontend(path, directory=..., fallback="auto", check_dir="auto")` serves a built SPA; API routes match first and the frontend is consulted only through `_match_low_priority`, with `fallback="auto"` preferring `404.html` and falling back to `index.html` only for navigation requests that accept `text/html`. — [fastapi/applications.py#L1222-1299](https://github.com/fastapi/fastapi/blob/50113da16fec53b66b80d75e80a89296de4fa5a5/fastapi/applications.py#L1222-L1299) [fastapi/routing.py#L1944-1973](https://github.com/fastapi/fastapi/blob/50113da16fec53b66b80d75e80a89296de4fa5a5/fastapi/routing.py#L1944-L1973) [fastapi/routing.py#L2037-2045](https://github.com/fastapi/fastapi/blob/50113da16fec53b66b80d75e80a89296de4fa5a5/fastapi/routing.py#L2037-L2045)
- Seven security schemes ship in `fastapi/security/`: `APIKeyQuery`, `APIKeyHeader`, `APIKeyCookie`, `HTTPBasic`, `HTTPBearer`, `HTTPDigest`, `OAuth2` (with `OAuth2PasswordBearer` and `OAuth2AuthorizationCodeBearer`) and `OpenIdConnect`, plus the `OAuth2PasswordRequestForm` dependency and `SecurityScopes`. — [fastapi/security/__init__.py#L1-15](https://github.com/fastapi/fastapi/blob/50113da16fec53b66b80d75e80a89296de4fa5a5/fastapi/security/__init__.py#L1-L15) [fastapi/security/oauth2.py#L14-330](https://github.com/fastapi/fastapi/blob/50113da16fec53b66b80d75e80a89296de4fa5a5/fastapi/security/oauth2.py#L14-L330) [fastapi/security/api_key.py](https://github.com/fastapi/fastapi/blob/50113da16fec53b66b80d75e80a89296de4fa5a5/fastapi/security/api_key.py)
- Dependency scoping is a first-class feature: `params.Depends` is a frozen dataclass carrying `dependency`, `use_cache` and `scope: Literal["function", "request"] | None`, and `DependencyScopeError` is raised at `get_dependant` time if a request-scoped generator dependency depends on a function-scoped one. — [fastapi/params.py#L745-755](https://github.com/fastapi/fastapi/blob/50113da16fec53b66b80d75e80a89296de4fa5a5/fastapi/params.py#L745-L755) [fastapi/dependencies/utils.py#L302-317](https://github.com/fastapi/fastapi/blob/50113da16fec53b66b80d75e80a89296de4fa5a5/fastapi/dependencies/utils.py#L302-L317) [fastapi/exceptions.py#L167-172](https://github.com/fastapi/fastapi/blob/50113da16fec53b66b80d75e80a89296de4fa5a5/fastapi/exceptions.py#L167-L172)
- `app.webhooks` is a dedicated `APIRouter` whose routes are documented under the OpenAPI `webhooks` key rather than `paths`. — [fastapi/applications.py#L936-948](https://github.com/fastapi/fastapi/blob/50113da16fec53b66b80d75e80a89296de4fa5a5/fastapi/applications.py#L936-L948) [fastapi/openapi/utils.py#L647-666](https://github.com/fastapi/fastapi/blob/50113da16fec53b66b80d75e80a89296de4fa5a5/fastapi/openapi/utils.py#L647-L666)
- `strict_content_type` (default `True`) is threaded from app → router → route → handler; when False, a body with no Content-Type header is still parsed as JSON. — [fastapi/applications.py#L996](https://github.com/fastapi/fastapi/blob/50113da16fec53b66b80d75e80a89296de4fa5a5/fastapi/applications.py#L996) [fastapi/routing.py#L390-394](https://github.com/fastapi/fastapi/blob/50113da16fec53b66b80d75e80a89296de4fa5a5/fastapi/routing.py#L390-L394) [fastapi/routing.py#L433-437](https://github.com/fastapi/fastapi/blob/50113da16fec53b66b80d75e80a89296de4fa5a5/fastapi/routing.py#L433-L437)
- `ORJSONResponse` and `UJSONResponse` are marked `@deprecated` with `FastAPIDeprecationWarning`, directing users to declare a return type so Pydantic serializes on the Rust side instead. — [fastapi/responses.py#L42-101](https://github.com/fastapi/fastapi/blob/50113da16fec53b66b80d75e80a89296de4fa5a5/fastapi/responses.py#L42-L101) [fastapi/exceptions.py#L252-256](https://github.com/fastapi/fastapi/blob/50113da16fec53b66b80d75e80a89296de4fa5a5/fastapi/exceptions.py#L252-L256)
- `app.dependency_overrides` is a plain dict on the app used as the `dependency_overrides_provider`; `solve_dependencies` re-derives a fresh `Dependant` for any overridden callable so the substitute's own signature is honoured. — [fastapi/applications.py#L966-985](https://github.com/fastapi/fastapi/blob/50113da16fec53b66b80d75e80a89296de4fa5a5/fastapi/applications.py#L966-L985) [fastapi/dependencies/utils.py#L621-637](https://github.com/fastapi/fastapi/blob/50113da16fec53b66b80d75e80a89296de4fa5a5/fastapi/dependencies/utils.py#L621-L637)
- Repo-level developer features beyond the library: `scripts/docs.py` is a Typer CLI for building/serving the 13-locale docs site and generating `README.md` from `docs/en/docs/index.md`, and `scripts/translate.py` drives a `pydantic_ai.Agent("openai-chat:gpt-5.5")` to machine-translate docs pages. — [scripts/docs.py#L1-50](https://github.com/fastapi/fastapi/blob/50113da16fec53b66b80d75e80a89296de4fa5a5/scripts/docs.py#L1-L50) [scripts/translate.py#L1-40](https://github.com/fastapi/fastapi/blob/50113da16fec53b66b80d75e80a89296de4fa5a5/scripts/translate.py#L1-L40) [scripts/translate.py#L140](https://github.com/fastapi/fastapi/blob/50113da16fec53b66b80d75e80a89296de4fa5a5/scripts/translate.py#L140)

Every claim links to its cited files at the pinned commit. Citations identify source evidence; they do not establish runtime correctness. Independent CodeVetter scan — not reviewed by upstream maintainers.

## Public product links

- [CodeVetter](https://codevetter.com/)
- [Download](https://codevetter.com/download)
- [Documentation](https://codevetter.com/docs/)
- [Source](https://github.com/Codevetter/codevetter)
