← All recipes
Moderne licensed

Upgrade to Pydantic 2.12

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

Migrate code affected by changes introduced in Pydantic 2.12 (and 2.10/2.11). Flags serialize_as_any usage affected by the 2.12 unification with the SerializeAsAny annotation.

Composite recipepythonpydanticmigration2.12Proprietary

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.UpgradeToPydantic212

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.