← ClaudeAtlas

fastapi-patternslisted

FastAPI patterns, Pydantic schemas, dependency injection, async correctness, response models, error handling, OpenAPI, and auth. Use whenever the project contains `fastapi` in dependencies, files importing from `fastapi`, `@app.get`/`@router.get` decorators, Pydantic BaseModel subclasses used as request/response types, OR the user asks about FastAPI, Pydantic v2, Depends(), HTTPException, OAuth2PasswordBearer, APIKeyHeader, response_model, even if FastAPI is not mentioned by name.
ku5ic/dotfiles · ★ 0 · API & Backend · score 72
Install: claude install-skill ku5ic/dotfiles
# FastAPI patterns FastAPI 0.141.x, Pydantic 2.13.x (baseline at time of writing). Verify current versions at https://pypi.org/project/fastapi/ and https://pypi.org/project/pydantic/. Adapt advice to the versions in the project's `requirements.txt`, `pyproject.toml`, or lockfile. Install: `pip install "fastapi[standard]"` ## Reference files | File | Covers | | ------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------- | | [pydantic-schemas.md](reference/pydantic-schemas.md) | BaseModel, Field(), field_validator, model_validator, model_config, ConfigDict, separate input/output schemas | | [dependency-injection.md](reference/dependency-injection.md) | Depends(), Annotated pattern, yield dependencies, testing overrides | | [async-correctness.md](reference/async-correctness.md) | async def vs def, threadpool behavior, blocking I/O rules | | [response-models.md](reference/response-models.md) | response_model, response_model_exclude_unset, separate schemas | | [error-handling.md](reference/error-handling.md) | HTTPException, custom exce