Skip to content

Feature: make GitUser's date field to be date-time #201

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion githubkit/versions/ghec_v2022_11_28/models/group_0261.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

from __future__ import annotations

from datetime import datetime

from pydantic import Field

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

name: Missing[str] = Field(default=UNSET)
email: Missing[str] = Field(default=UNSET)
date: Missing[str] = Field(default=UNSET)
date: Missing[datetime] = Field(default=UNSET)


model_rebuild(GitUser)
Expand Down
3 changes: 2 additions & 1 deletion githubkit/versions/ghec_v2022_11_28/types/group_0261.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

from __future__ import annotations

from datetime import datetime
from typing_extensions import NotRequired, TypedDict


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

name: NotRequired[str]
email: NotRequired[str]
date: NotRequired[str]
date: NotRequired[datetime]


__all__ = ("GitUserType",)
4 changes: 3 additions & 1 deletion githubkit/versions/v2022_11_28/models/group_0221.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

from __future__ import annotations

from datetime import datetime

from pydantic import Field

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

name: Missing[str] = Field(default=UNSET)
email: Missing[str] = Field(default=UNSET)
date: Missing[str] = Field(default=UNSET)
date: Missing[datetime] = Field(default=UNSET)


model_rebuild(GitUser)
Expand Down
3 changes: 2 additions & 1 deletion githubkit/versions/v2022_11_28/types/group_0221.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

from __future__ import annotations

from datetime import datetime
from typing_extensions import NotRequired, TypedDict


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

name: NotRequired[str]
email: NotRequired[str]
date: NotRequired[str]
date: NotRequired[datetime]


__all__ = ("GitUserType",)
5 changes: 5 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,11 @@ source = "https://raw.githubusercontent.com/github/rest-api-description/main/des
"null",
] }

# https://github.com/yanyongyu/githubkit/issues/199
# https://github.com/github/rest-api-description/issues/4697
# git user date format should be date-time
"/components/schemas/git-user/properties/date" = { format = "date-time" }

# https://github.com/yanyongyu/githubkit/pull/134
# blob_url and raw_url may be null when the diff file is submodule's file
"/components/schemas/diff-entry/properties/blob_url" = { type = [
Expand Down