Skip to content
masterclass Buddy

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.

Subscribe
  • Annotated
  • Field
  • TypeAliasType
  • Gt
  • Len
  • TypeAdapter
  • WithJsonSchema
  • AfterValidator

Source: Types | Pydantic Docs. Checked 2026-11-03.