Closed
Description
When trying to add a pydantic v2 model validator to my aredis_om JsonModel, a RecursionError occurs. When testing both aredis_om and the validator separately, both work without error. When testing together a maximum depth search error occurs.
Here is example code that recreates this issue...
from aredis_om import JsonModel
from pydantic import model_validator
class Test(JsonModel):
name: str
@model_validator(mode='after')
async def create_name(self):
self.name = 'this is different'
return self
@classmethod
async def create(cls, name):
test = cls(name=name)
await test.save()
Metadata
Metadata
Assignees
Labels
No labels