This skill provides standardized implementation patterns for Pydantic V2, specifically focusing on the mandatory use of strict mode to prevent silent type conversions. It guides users through modern V2 syntax, including ConfigDict for model configuration, updated field and model validators, and optimized serialization methods like model_dump. By enforcing best practices and identifying deprecated V1 anti-patterns, this skill ensures that data contracts, API schemas, and configuration classes are robust, performant, and type-safe.
Key Features
01Strict mode enforcement via ConfigDict to prevent silent type coercion
02Advanced field aliasing for mapping external API data to Pythonic names
03Modern Pydantic V2 validator syntax for field and model-level logic
040 GitHub stars
05Type-safe nested model composition for complex data structures
06Standardized serialization and validation using model_dump and model_validate