Skip to content
masterclass Buddy

Pydantic · Method

TypeAdapter.validate_python

TypeAdapter validates, serializes, and generates JSON schemas for a type without a BaseModel. It works with collections, primitive types, dataclasses, and other Pydantic-compatible types.

Last updated

Syntax

def validate_python(
    object: Any,
    /,
    *,
    strict: bool | None = None,
    from_attributes: bool | None = None,
    context: dict[str, Any] | None = None,
) -> T

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

Subscribe
  • BaseModel
  • RootModel
  • validate_json
  • validate_strings
  • get_default_value
  • dump_json
  • rebuild

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