← All recipes
Moderne licensed

Upgrade to Pydantic 2.10

Recipe IDorg.openrewrite.python.migrate.pydantic.UpgradeToPydantic210Artifactopenrewrite-migrate-python

Flag and migrate code affected by deprecations introduced in Pydantic 2.10, such as the deprecated schema_generator config option and the discouraged Field(...) Ellipsis form. Also flags the deprecated json_encoders config option.

Composite recipepythonpydanticmigration2.10Proprietary

Usage

This recipe has no required configuration options. You’ll need the Moderne CLI configured before running the command below.

mod run . --recipe org.openrewrite.python.migrate.pydantic.UpgradeToPydantic210

If the recipe isn’t available locally, install it with:

mod config recipes pip install openrewrite-migrate-python

Definition

This recipe runs the following recipes in order.