Skip to content

Commit 87d31fe

Browse files
authored
✨ Feature: make GitUser's date field to be date-time (#201)
1 parent 151d08c commit 87d31fe

File tree

5 files changed

+15
-4
lines changed

5 files changed

+15
-4
lines changed

githubkit/versions/ghec_v2022_11_28/models/group_0261.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99

1010
from __future__ import annotations
1111

12+
from datetime import datetime
13+
1214
from pydantic import Field
1315

1416
from githubkit.compat import GitHubModel, model_rebuild
@@ -24,7 +26,7 @@ class GitUser(GitHubModel):
2426

2527
name: Missing[str] = Field(default=UNSET)
2628
email: Missing[str] = Field(default=UNSET)
27-
date: Missing[str] = Field(default=UNSET)
29+
date: Missing[datetime] = Field(default=UNSET)
2830

2931

3032
model_rebuild(GitUser)

githubkit/versions/ghec_v2022_11_28/types/group_0261.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
from __future__ import annotations
1111

12+
from datetime import datetime
1213
from typing_extensions import NotRequired, TypedDict
1314

1415

@@ -20,7 +21,7 @@ class GitUserType(TypedDict):
2021

2122
name: NotRequired[str]
2223
email: NotRequired[str]
23-
date: NotRequired[str]
24+
date: NotRequired[datetime]
2425

2526

2627
__all__ = ("GitUserType",)

githubkit/versions/v2022_11_28/models/group_0221.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99

1010
from __future__ import annotations
1111

12+
from datetime import datetime
13+
1214
from pydantic import Field
1315

1416
from githubkit.compat import GitHubModel, model_rebuild
@@ -24,7 +26,7 @@ class GitUser(GitHubModel):
2426

2527
name: Missing[str] = Field(default=UNSET)
2628
email: Missing[str] = Field(default=UNSET)
27-
date: Missing[str] = Field(default=UNSET)
29+
date: Missing[datetime] = Field(default=UNSET)
2830

2931

3032
model_rebuild(GitUser)

githubkit/versions/v2022_11_28/types/group_0221.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
from __future__ import annotations
1111

12+
from datetime import datetime
1213
from typing_extensions import NotRequired, TypedDict
1314

1415

@@ -20,7 +21,7 @@ class GitUserType(TypedDict):
2021

2122
name: NotRequired[str]
2223
email: NotRequired[str]
23-
date: NotRequired[str]
24+
date: NotRequired[datetime]
2425

2526

2627
__all__ = ("GitUserType",)

pyproject.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,11 @@ source = "https://raw.githubusercontent.com/github/rest-api-description/main/des
348348
"null",
349349
] }
350350

351+
# https://github.com/yanyongyu/githubkit/issues/199
352+
# https://github.com/github/rest-api-description/issues/4697
353+
# git user date format should be date-time
354+
"/components/schemas/git-user/properties/date" = { format = "date-time" }
355+
351356
# https://github.com/yanyongyu/githubkit/pull/134
352357
# blob_url and raw_url may be null when the diff file is submodule's file
353358
"/components/schemas/diff-entry/properties/blob_url" = { type = [

0 commit comments

Comments
 (0)