Pydantic v2 Patterns Problem Statement Pydantic v2 has significant API changes from v1. This codebase uses v2. Wrong patterns cause validation failures, serialization bugs, and frontend integration issues. --- Pattern: v1 to v2 Migration Critical changes to know: Quick reference: | v1 | v2 | |----|-----| | | | | | | | | | | | | | | | | | | | | | | | | --- Pattern: Field Validators --- Pattern: Model Validators --- Pattern: Model Configuration --- Pattern: Field Definitions --- Pattern: Discriminated Unions Problem: Polymorphic responses where type depends on a field. --- Pattern: Custom Types…