Skip to content
masterclass Buddy

Pydantic · Error

PydanticUseDefault

PydanticUseDefault is an exception that custom validators can raise to make Pydantic use a field's default value. It is useful when a special input, such as None, should select that default.

Last updated

Syntax

raise PydanticUseDefault()

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

Subscribe
  • BeforeValidator
  • field_validator
  • pydantic_core
  • PydanticSerializationError
  • PydanticSerializationUnexpectedValue

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