Skip to content

Commit

Permalink
Merge pull request #113 from Indicio-tech/feature/pydantic-v2
Browse files Browse the repository at this point in the history
feat: pydantic v2 models
  • Loading branch information
dbluhm authored Jul 8, 2024
2 parents eb717e5 + d1e0b42 commit fe666db
Show file tree
Hide file tree
Showing 5 changed files with 3,304 additions and 3,630 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 fe666db

Please sign in to comment.