Skip to content

Commit 7f24514

Browse files
committed
fix: BaseModel.model_validate return type
1 parent 9a81673 commit 7f24514

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

doc/changelog.rst

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ Changelog
77
Fixed
88
^^^^^
99
- Python 3.9 and 3.10 compatibility.
10+
- :meth:`~scim2_models.BaseModel.model_validate` types.
1011

1112
[0.2.3] - 2024-11-01
1213
--------------------

scim2_models/base.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -719,7 +719,7 @@ def model_serializer_exclude_none(
719719
@classmethod
720720
def model_validate(
721721
cls, *args, scim_ctx: Optional[Context] = Context.DEFAULT, **kwargs
722-
) -> "BaseModel":
722+
) -> Self:
723723
"""Validate SCIM payloads and generate model representation by using Pydantic :code:`BaseModel.model_validate`."""
724724
kwargs.setdefault("context", {}).setdefault("scim", scim_ctx)
725725
return super().model_validate(*args, **kwargs)
@@ -731,7 +731,7 @@ def model_dump(
731731
attributes: Optional[list[str]] = None,
732732
excluded_attributes: Optional[list[str]] = None,
733733
**kwargs,
734-
):
734+
) -> dict:
735735
"""Create a model representation that can be included in SCIM messages by using Pydantic :code:`BaseModel.model_dump`.
736736
737737
:param scim_ctx: If a SCIM context is passed, some default values of

0 commit comments

Comments
 (0)