From 8a95b8a46cdb8cc4d762db31124eec09218e6715 Mon Sep 17 00:00:00 2001 From: Ju4tCode <42488585+yanyongyu@users.noreply.github.com> Date: Mon, 13 Apr 2026 03:23:24 +0000 Subject: [PATCH] :bug: fix search repo item missing field --- githubkit/versions/ghec_v2022_11_28/models/group_0548.py | 2 +- githubkit/versions/ghec_v2022_11_28/types/group_0548.py | 4 ++-- githubkit/versions/ghec_v2026_03_10/models/group_0546.py | 2 +- githubkit/versions/ghec_v2026_03_10/types/group_0546.py | 4 ++-- githubkit/versions/v2022_11_28/models/group_0463.py | 2 +- githubkit/versions/v2022_11_28/types/group_0463.py | 4 ++-- githubkit/versions/v2026_03_10/models/group_0461.py | 2 +- githubkit/versions/v2026_03_10/types/group_0461.py | 4 ++-- githubkit/versions/versions.lock | 1 + pyproject.toml | 3 +++ 10 files changed, 16 insertions(+), 12 deletions(-) diff --git a/githubkit/versions/ghec_v2022_11_28/models/group_0548.py b/githubkit/versions/ghec_v2022_11_28/models/group_0548.py index 1bb439791..4dc1fa91b 100644 --- a/githubkit/versions/ghec_v2022_11_28/models/group_0548.py +++ b/githubkit/versions/ghec_v2022_11_28/models/group_0548.py @@ -101,7 +101,7 @@ class RepoSearchResultItem(GitHubModel): has_projects: bool = Field() has_pages: bool = Field() has_wiki: bool = Field() - has_downloads: bool = Field() + has_downloads: Missing[bool] = Field(default=UNSET) has_discussions: Missing[bool] = Field(default=UNSET) has_pull_requests: Missing[bool] = Field(default=UNSET) pull_request_creation_policy: Missing[Literal["all", "collaborators_only"]] = Field( diff --git a/githubkit/versions/ghec_v2022_11_28/types/group_0548.py b/githubkit/versions/ghec_v2022_11_28/types/group_0548.py index 7b13aeaa4..03ae8fa92 100644 --- a/githubkit/versions/ghec_v2022_11_28/types/group_0548.py +++ b/githubkit/versions/ghec_v2022_11_28/types/group_0548.py @@ -99,7 +99,7 @@ class RepoSearchResultItemType(TypedDict): has_projects: bool has_pages: bool has_wiki: bool - has_downloads: bool + has_downloads: NotRequired[bool] has_discussions: NotRequired[bool] has_pull_requests: NotRequired[bool] pull_request_creation_policy: NotRequired[Literal["all", "collaborators_only"]] @@ -198,7 +198,7 @@ class RepoSearchResultItemTypeForResponse(TypedDict): has_projects: bool has_pages: bool has_wiki: bool - has_downloads: bool + has_downloads: NotRequired[bool] has_discussions: NotRequired[bool] has_pull_requests: NotRequired[bool] pull_request_creation_policy: NotRequired[Literal["all", "collaborators_only"]] diff --git a/githubkit/versions/ghec_v2026_03_10/models/group_0546.py b/githubkit/versions/ghec_v2026_03_10/models/group_0546.py index 073be8183..7c6a1121b 100644 --- a/githubkit/versions/ghec_v2026_03_10/models/group_0546.py +++ b/githubkit/versions/ghec_v2026_03_10/models/group_0546.py @@ -101,7 +101,7 @@ class RepoSearchResultItem(GitHubModel): has_projects: bool = Field() has_pages: bool = Field() has_wiki: bool = Field() - has_downloads: bool = Field() + has_downloads: Missing[bool] = Field(default=UNSET) has_discussions: Missing[bool] = Field(default=UNSET) has_pull_requests: Missing[bool] = Field(default=UNSET) pull_request_creation_policy: Missing[Literal["all", "collaborators_only"]] = Field( diff --git a/githubkit/versions/ghec_v2026_03_10/types/group_0546.py b/githubkit/versions/ghec_v2026_03_10/types/group_0546.py index 0a209d944..ccd76cf98 100644 --- a/githubkit/versions/ghec_v2026_03_10/types/group_0546.py +++ b/githubkit/versions/ghec_v2026_03_10/types/group_0546.py @@ -99,7 +99,7 @@ class RepoSearchResultItemType(TypedDict): has_projects: bool has_pages: bool has_wiki: bool - has_downloads: bool + has_downloads: NotRequired[bool] has_discussions: NotRequired[bool] has_pull_requests: NotRequired[bool] pull_request_creation_policy: NotRequired[Literal["all", "collaborators_only"]] @@ -198,7 +198,7 @@ class RepoSearchResultItemTypeForResponse(TypedDict): has_projects: bool has_pages: bool has_wiki: bool - has_downloads: bool + has_downloads: NotRequired[bool] has_discussions: NotRequired[bool] has_pull_requests: NotRequired[bool] pull_request_creation_policy: NotRequired[Literal["all", "collaborators_only"]] diff --git a/githubkit/versions/v2022_11_28/models/group_0463.py b/githubkit/versions/v2022_11_28/models/group_0463.py index 690df1c55..e3a5e7fbb 100644 --- a/githubkit/versions/v2022_11_28/models/group_0463.py +++ b/githubkit/versions/v2022_11_28/models/group_0463.py @@ -101,7 +101,7 @@ class RepoSearchResultItem(GitHubModel): has_projects: bool = Field() has_pages: bool = Field() has_wiki: bool = Field() - has_downloads: bool = Field() + has_downloads: Missing[bool] = Field(default=UNSET) has_discussions: Missing[bool] = Field(default=UNSET) has_pull_requests: Missing[bool] = Field(default=UNSET) pull_request_creation_policy: Missing[Literal["all", "collaborators_only"]] = Field( diff --git a/githubkit/versions/v2022_11_28/types/group_0463.py b/githubkit/versions/v2022_11_28/types/group_0463.py index 37ce9775e..78f5f0eeb 100644 --- a/githubkit/versions/v2022_11_28/types/group_0463.py +++ b/githubkit/versions/v2022_11_28/types/group_0463.py @@ -99,7 +99,7 @@ class RepoSearchResultItemType(TypedDict): has_projects: bool has_pages: bool has_wiki: bool - has_downloads: bool + has_downloads: NotRequired[bool] has_discussions: NotRequired[bool] has_pull_requests: NotRequired[bool] pull_request_creation_policy: NotRequired[Literal["all", "collaborators_only"]] @@ -198,7 +198,7 @@ class RepoSearchResultItemTypeForResponse(TypedDict): has_projects: bool has_pages: bool has_wiki: bool - has_downloads: bool + has_downloads: NotRequired[bool] has_discussions: NotRequired[bool] has_pull_requests: NotRequired[bool] pull_request_creation_policy: NotRequired[Literal["all", "collaborators_only"]] diff --git a/githubkit/versions/v2026_03_10/models/group_0461.py b/githubkit/versions/v2026_03_10/models/group_0461.py index a7aecb212..2d5b2c546 100644 --- a/githubkit/versions/v2026_03_10/models/group_0461.py +++ b/githubkit/versions/v2026_03_10/models/group_0461.py @@ -101,7 +101,7 @@ class RepoSearchResultItem(GitHubModel): has_projects: bool = Field() has_pages: bool = Field() has_wiki: bool = Field() - has_downloads: bool = Field() + has_downloads: Missing[bool] = Field(default=UNSET) has_discussions: Missing[bool] = Field(default=UNSET) has_pull_requests: Missing[bool] = Field(default=UNSET) pull_request_creation_policy: Missing[Literal["all", "collaborators_only"]] = Field( diff --git a/githubkit/versions/v2026_03_10/types/group_0461.py b/githubkit/versions/v2026_03_10/types/group_0461.py index 4812443bf..d730d7765 100644 --- a/githubkit/versions/v2026_03_10/types/group_0461.py +++ b/githubkit/versions/v2026_03_10/types/group_0461.py @@ -99,7 +99,7 @@ class RepoSearchResultItemType(TypedDict): has_projects: bool has_pages: bool has_wiki: bool - has_downloads: bool + has_downloads: NotRequired[bool] has_discussions: NotRequired[bool] has_pull_requests: NotRequired[bool] pull_request_creation_policy: NotRequired[Literal["all", "collaborators_only"]] @@ -198,7 +198,7 @@ class RepoSearchResultItemTypeForResponse(TypedDict): has_projects: bool has_pages: bool has_wiki: bool - has_downloads: bool + has_downloads: NotRequired[bool] has_discussions: NotRequired[bool] has_pull_requests: NotRequired[bool] pull_request_creation_policy: NotRequired[Literal["all", "collaborators_only"]] diff --git a/githubkit/versions/versions.lock b/githubkit/versions/versions.lock index a5df228da..6161c6d85 100644 --- a/githubkit/versions/versions.lock +++ b/githubkit/versions/versions.lock @@ -77,6 +77,7 @@ source = "https://raw.githubusercontent.com/github/rest-api-description/3ba1e727 "/components/schemas/repository-webhooks/properties/temp_clone_token" = {type = ["string", "null"]} "/components/schemas/repository-webhooks/properties/template_repository/properties/temp_clone_token" = {type = ["string", "null"]} "/components/schemas/repository/properties/owner" = {anyOf = [{type = "null"}, {"$ref" = "#/components/schemas/simple-user"}], "$ref" = ""} +"/components/schemas/repo-search-result-item/required" = {"" = ["has_downloads"]} "/components/schemas/auto-merge/properties/commit_title" = {type = ["string", "null"]} "/components/schemas/auto-merge/properties/commit_message" = {type = ["string", "null"]} "/paths/~1repos~1{owner}~1{repo}~1releases/post/requestBody/content/application~1json/schema/properties/make_latest" = {default = "true"} diff --git a/pyproject.toml b/pyproject.toml index 7da6bedec..fa2b7c487 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -328,6 +328,9 @@ source = "descriptions-next/ghec/ghec.2026-03-10.json" { "$ref" = "#/components/schemas/simple-user" }, ], "$ref" = "" } +# https://github.com/yanyongyu/githubkit/issues/293 +"/components/schemas/repo-search-result-item/required" = { "" = ["has_downloads"] } + # https://github.com/github/rest-api-description/issues/2491 "/components/schemas/auto-merge/properties/commit_title" = { type = [ "string",