From d01733b9353643557c41e7320244a68548f0c749 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Voron?= Date: Tue, 26 Sep 2023 11:33:50 +0200 Subject: [PATCH] :sparkles: Feature: Tweak `Missing` type to implicitly allow `None` values (#48) Co-authored-by: Ju4tCode <42488585+yanyongyu@users.noreply.github.com> --- githubkit/utils.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/githubkit/utils.py b/githubkit/utils.py index 9e30edb9..cc6946cb 100644 --- a/githubkit/utils.py +++ b/githubkit/utils.py @@ -39,7 +39,9 @@ def _validate(cls, value: Any): UNSET = Unset._UNSET -Missing: TypeAlias = Union[Literal[UNSET], T] +# if the property is not required, we allow it to have the value null. +# See https://github.com/yanyongyu/githubkit/issues/47 +Missing: TypeAlias = Union[Literal[UNSET], T, None] def exclude_unset(data: Any) -> Any: