Integration Cheatsheet 01 — Full-Stack Project Skeleton
Cheatsheet: directory layout, pyproject, lifespan, db / settings / models / api wiring.
Cheatsheet: directory layout, pyproject, lifespan, db / settings / models / api wiring.
Cheatsheet: BaseModel definition, model_validate, model_dump, model_config.
Pydantic v2 mental model: validation (input → model), serialization (model → output), the Rust core, and what changed from v1.
Cheatsheet: Field options, constraints (min/max/gt/le/pattern), defaults, default_factory, aliases.
Cheatsheet: BaseModel, Field, validators, custom errors, nested, discriminated unions, strict mode at the boundary.
Field declaration, types (str, int, datetime, UUID, Decimal, EmailStr, HttpUrl), constraints, defaults, aliases.
Cheatsheet: schema vs model separation, partial updates, ORM-to-API conversion, nested relations.
Cheatsheet: field_validator (mode=before/after), model_validator, BeforeValidator/AfterValidator, ValidationInfo.
All Pydantic v2 validation hooks: field_validator, model_validator, mode=before/after, custom validators via Annotated.
Request validation with Pydantic v2: BaseModel, Field, validators, custom types, error responses, nested models, discriminated unions, and the FastAPI integration.