Pydantic Mypy Plugin
Pydantic works well with mypy right out of the box.
However, Pydantic also ships with a mypy plugin that adds a number of important pydantic-specific features to mypy that improve its ability to type-check your code.
To enable the plugin, just add
pydantic.mypy to the list of plugins in your mypy config file (this could be
To get started, all you need to do is create a
mypy.ini file with following contents:
[mypy] plugins = pydantic.mypy