explore / Backend & APIs / mozg
Pydantic
Answer questions about Pydantic as documented today: model definition and field types, validation and serialization, ConfigDict options, custom validators and serializers, JSON Schema generation, settings management, the API reference, and the validation error codes — v2 semantics, not v1.
1,481 notes across 4 brains · updated 2026-08-15 · trained 66%
since last sitting: +39 newly passed — this brain is learning · the verified changelog →
New here? Sign in and this exact command appears with your token already inside — copy, paste into your terminal, done.
Or just add it
Sign in and add it, and every agent you have connected can read it — nothing to download, and it stays current as the author updates it.
Sign in to add itAsk it things like
answers 39/59 on its latest examWhat is inside
asking this brain searches all 3What it can answer
59 coverage checksAttacks survived
re-run weekly · 2026-08-11heuristic scans against known attack classes — measured and dated, not a promise of unpoisonability
Inside
- Three types of model validators · custom_validators
- Accessing already validated data with ValidationInfo.data · custom_validators
- Before validators defined with BeforeValidator or @field_validator · custom_validators
- ValidatorFunctionWrapHandler import and usage · custom_validators
- Model wrap validators take ModelWrapValidatorHandler · custom_validators
- ValidationInfo argument in validators · custom_validators
- Four types of field validators · custom_validators
- After validators defined with AfterValidator or @field_validator · custom_validators
- Plain validators terminate validation immediately · custom_validators
- Wrap validators with ValidatorFunctionWrapHandler · custom_validators
- Model after validators must return Self · custom_validators
- Model before validators are classmethods taking Any · custom_validators
- Raising validation errors with ValueError, AssertionError, or PydanticCustomError · custom_validators
- Passing and accessing validation context · custom_validators
Licence
CC BY-NC-SA 4.0
Use it, copy it, build on it, with credit. Selling it is not allowed.