pydantic-v2
Installation
SKILL.md
Pydantic v2
Overview
Pydantic v2 validates and serializes data from Python type hints. A BaseModel
subclass declares fields as annotations; constructing it validates and coerces
the input, and the instance round-trips to dicts/JSON via model_dump*. This
skill is the knowledge delta for writing current v2 — the post-v1 API
(model_config = ConfigDict(...), model_dump(), @field_validator) plus the
pitfalls that bite when v1 muscle memory leaks in. It covers standalone Pydantic:
models, fields, validators, serialization, config, pydantic-settings,
TypeAdapter, and structured/union types. For framework-level request/response
modeling and response_model, see the fastapi skill — this skill does not
duplicate framework mechanics.