# Fastapi Review

> FastAPI review checklist — what to check in FastAPI code, by severity. A reference for writing and reviewing it; in a workflow run the review step records each problem as a finding and the engine decides what blocks.

- Skill: `keyvaluesoftwaresystems/fastapi-review` (Agent Skill)
- Install (CLI): `npx get-skill add keyvaluesoftwaresystems/fastapi-review`
- Raw SKILL.md: https://api.skillmd.com/api/skills/keyvaluesoftwaresystems/fastapi-review/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Productivity
- Author: keyvaluesoftwaresystems (https://skillmd.com/u/keyvaluesoftwaresystems)
- Updated: 2026-11-11
- Page: https://skillmd.com/skills/keyvaluesoftwaresystems/fastapi-review

---


# FastAPI review checklist

Use this when writing or reviewing FastAPI code. The severities say how serious a problem is; they are guidance for a finding's severity, not a verdict.

## Review Scope

- FastAPI app construction, routing, middleware, and exception handling.
- Pydantic request, update, and response models.
- Async database and HTTP patterns.
- Dependency injection for database sessions, auth, pagination, and settings.
- Authentication, authorization, CORS, rate limits, logging, and secret handling.
- Test dependency overrides and client setup.
- OpenAPI metadata and generated docs.

## Out of Scope

- Non-FastAPI frameworks unless they directly interact with the FastAPI app.
- Broad Python style review already covered by `python-review`.
- Dependency additions without a concrete problem and maintenance rationale.

## Finding Priorities

### Critical

- Hardcoded secrets or tokens.
- SQL built through string interpolation.
- Passwords, token hashes, or internal auth fields exposed in response models.
- Auth dependencies that can be bypassed or do not validate expiry/signature.

### High

- Blocking database or HTTP clients inside async routes.
- Database sessions created inline in handlers instead of dependencies.
- Test overrides targeting the wrong dependency.
- `allow_origins=["*"]` combined with credentialed CORS.
- Missing request validation for write endpoints.

### Medium

- Missing pagination on list endpoints.
- OpenAPI docs missing response models or error response descriptions.
- Duplicated route logic that should move into a service/dependency.
- Missing timeout settings for external HTTP clients.

