Start here
The safe first move
If the validator uses the supported direct-import path and the simple classmethod signature, the clean rewrite is @field_validator.
Stop before automation when: Validators that use values, field, config, each_item, or always. Alias-heavy imports.
Target shape
from pydantic import BaseModel, field_validator
class UserModel(BaseModel):
email: str
@field_validator("email")
def normalize_email(cls, value: str) -> str:
return value.strip().lower()