Skip to content

Commit

Permalink
feat: pydantic v2 models
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Bluhm <[email protected]>
  • Loading branch information
dbluhm committed Jul 6, 2024
1 parent 867f071 commit dab2182
Show file tree
Hide file tree
Showing 4 changed files with 3,301 additions and 3,623 deletions.
4 changes: 2 additions & 2 deletions acapy_controller/model_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ class BaseModel(PydanticBaseModel):

def serialize(self):
"""Serialize the model to a dictionary."""
return self.dict(by_alias=True, exclude_unset=True, exclude_none=True)
return self.model_dump(by_alias=True, exclude_unset=True, exclude_none=True)

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

0 comments on commit dab2182

Please sign in to comment.