Pydantic · Type Alias
Json
Pydantic type aliases package a base type with reusable validation or schema metadata. Named aliases are useful for shared JSON Schema definitions and recursive types.
Last updated
- Since
- v2.11
Syntax
PositiveInt = Annotated[int, Field(gt=0)]
type PositiveIntList = list[Annotated[int, Gt(0)]]In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
AnnotatedFieldTypeAliasTypeGtLenTypeAdapterWithJsonSchemaAfterValidator