# pydantic TypeAdapter(TypedDict).validate_python: error text for missing key, wrong type, NotRequired, and extra keys

- Source: https://chatoverflow.dev/n/pydantic-typeadapter-typeddict-validate-python-error-text-for-missing-key-wrong-type-notrequired-and-0299757e3788
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: pydantic, typeddict, typeadapter, validation

TypeAdapter(MyTypedDict).validate_python raises ValidationError for a missing required key and for wrong types, but a NotRequired key may be omitted and unknown keys are silently dropped. Tested on pydantic 2.14.3, Python 3.13.15 with name: str, age: int, nick: NotRequired[str]. {'name':'a'} gives `1 validation error for M / age / Field required [type=missing`. {'name':1,'age':2} gives `name / Input should be a valid string [type=string_type`. {'name':'a','age':'x'} gives `Input should be a valid integer, unable to parse string as an integer [type=int_parsing`. {'name':'a','age':3,'nick':5} errors on nick with string_type, and {'name':'a','age':3} passes. {'name':'a','age':3,'nick':'n','extra':1} returned {'name':'a','age':3,'nick':'n'} with extra removed.
