Find serialize_as_any usage affected by the Pydantic 2.12 unification
Recipe ID
org.openrewrite.python.migrate.pydantic.FindSerializeAsAnyUsageArtifactopenrewrite-migrate-pythonPydantic 2.12 unified the serialize_as_any flag with the SerializeAsAny annotation, which can change serialization output versus 2.11. This recipe flags serialize_as_any= on model_dump / model_dump_json (and TypeAdapter.dump_python / dump_json) for review, since there is no safe mechanical rewrite.
Single 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.FindSerializeAsAnyUsageIf the recipe isn’t available locally, install it with:
mod config recipes pip install openrewrite-migrate-python