Skip to content
masterclass Buddy

Pydantic · Module

model_fields

Pydantic fields combine a type annotation with optional defaults and metadata. You can inspect their definitions on the model class with model_fields.

Last updated

Since
v2.10 for default factories that accept validated data

Syntax

class Model(BaseModel):
    field_name: FieldType = Field(default=..., default_factory=...)

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • BaseModel
  • Field
  • FieldInfo
  • Annotated
  • WithJsonSchema
  • default_factory
  • __pydantic_fields__

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