Skip to content
masterclass Buddy

Pydantic · Decorator

model_validator

model_validator() validates data for the complete Pydantic model. Its mode controls whether the check runs before validation, after validation, or around the validation process.

Last updated

Syntax

@model_validator(mode='before' | 'after' | 'wrap')

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

Subscribe
  • field_validator()
  • BeforeValidator
  • AfterValidator
  • WrapValidator

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