Models, fields, and types
Define Pydantic models with typed fields, defaults, aliases, nested data, and discriminated unions. Handle strict input and partial updates.
12 topics
- Start here: Pydantic and its core
- Your first model
- Fields, constraints, and Annotated
- Required fields, defaults, and null
- Strict validation: Python versus JSON
- Model configuration
- Nested models and collections
- Dates, money, enums, URLs, and other useful types
- Input methods and output methods
- Partial updates: missing versus null
- Aliases and external field names
- Unions, Literal, and discriminators