Skip to content

Commit fe666db

Browse files
authored
Merge pull request #113 from Indicio-tech/feature/pydantic-v2
feat: pydantic v2 models
2 parents eb717e5 + d1e0b42 commit fe666db

File tree

5 files changed

+3304
-3630
lines changed

5 files changed

+3304
-3630
lines changed

acapy_controller/model_base.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ class BaseModel(PydanticBaseModel):
1818

1919
def serialize(self):
2020
"""Serialize the model to a dictionary."""
21-
return self.dict(by_alias=True, exclude_unset=True, exclude_none=True)
21+
return self.model_dump(by_alias=True, exclude_unset=True, exclude_none=True)
2222

2323
@classmethod
2424
def deserialize(cls: Type[T], value: Mapping[str, Any]) -> T:
2525
"""Deserialize a dictionary to a model."""
26-
return cls.parse_obj(value)
26+
return cls.model_validate(value)

0 commit comments

Comments
 (0)