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.