← 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.136.1, Pydantic 2.13.3 (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]"` ## When to load this skill - Project has `fastapi` in `requirements.txt`, `pyproject.toml`, or `Pipfile` - Files contain `from fastapi import`, `@app.get`, `@router.get` - Pydantic `BaseModel` used as route input/output type - User asks about FastAPI, Pydantic v2, dependency injection, Depends(), response_model, HTTPException, OAuth2, APIKey ## When not to load this skill - Django or Flask without FastAPI - Pydantic used outside a web framework (standalone validation) - GraphQL with strawberry or ariadne ## Reference files | File | Topics | | ------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------- | | [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 depende