Start here
The safe first move
For supported pre=True root validators with the simple (cls, values) signature, the v2 replacement is @model_validator(mode="before").
Stop before automation when: Post root validators. root_validator kwargs outside pre=True.
Target shape
from pydantic import BaseModel, model_validator
class Payload(BaseModel):
name: str
@model_validator(mode="before")
def normalize_input(cls, values):
return values