From 54ac6b265d2b7fe5cb3960a21c3e12be04a97c5f Mon Sep 17 00:00:00 2001 From: Trevor Manz Date: Mon, 11 Nov 2024 13:54:13 -0500 Subject: [PATCH] Add back dict/json methods with defaults --- src/higlass_schema/schema.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/higlass_schema/schema.py b/src/higlass_schema/schema.py index 0cf12b3..d031c67 100644 --- a/src/higlass_schema/schema.py +++ b/src/higlass_schema/schema.py @@ -26,10 +26,16 @@ class BaseModel(PydanticBaseModel): def __rich_repr__(self): return iter(self) - def model_dump(self, exclude_none: bool = True, **kwargs): + def dict(self, exclude_none: bool = True, **kwargs) -> Dict[str, Any]: + return super().dict(exclude_none=exclude_none, **kwargs) + + def json(self, exclude_none: bool = True, **kwargs) -> str: + return super().json(exclude_none=exclude_none, **kwargs) + + def model_dump(self, exclude_none: bool = True, **kwargs) -> Dict[str, Any]: return super().model_dump(exclude_none=exclude_none, **kwargs) - def model_dump_json(self, exclude_none: bool = True, **kwargs): + def model_dump_json(self, exclude_none: bool = True, **kwargs) -> str: return super().model_dump_json(exclude_none=exclude_none, **kwargs)