From f93250418713954bf6dffbba86a98b730165a452 Mon Sep 17 00:00:00 2001 From: Ju4tCode <42488585+yanyongyu@users.noreply.github.com> Date: Tue, 7 Oct 2025 13:43:21 +0000 Subject: [PATCH] :bug: fix discussion answer parent id --- githubkit/versions/ghec_v2022_11_28/models/group_0525.py | 2 +- githubkit/versions/ghec_v2022_11_28/types/group_0525.py | 2 +- githubkit/versions/v2022_11_28/models/group_0458.py | 2 +- githubkit/versions/v2022_11_28/types/group_0458.py | 2 +- githubkit/versions/versions.lock | 1 + pyproject.toml | 7 +++++++ 6 files changed, 12 insertions(+), 4 deletions(-) diff --git a/githubkit/versions/ghec_v2022_11_28/models/group_0525.py b/githubkit/versions/ghec_v2022_11_28/models/group_0525.py index ff2aa46c5..29b321ff4 100644 --- a/githubkit/versions/ghec_v2022_11_28/models/group_0525.py +++ b/githubkit/versions/ghec_v2022_11_28/models/group_0525.py @@ -42,7 +42,7 @@ class WebhooksAnswer(GitHubModel): html_url: str = Field() id: int = Field() node_id: str = Field() - parent_id: None = Field() + parent_id: Union[int, None] = Field() reactions: Missing[WebhooksAnswerPropReactions] = Field( default=UNSET, title="Reactions" ) diff --git a/githubkit/versions/ghec_v2022_11_28/types/group_0525.py b/githubkit/versions/ghec_v2022_11_28/types/group_0525.py index 32906747e..15c8ec597 100644 --- a/githubkit/versions/ghec_v2022_11_28/types/group_0525.py +++ b/githubkit/versions/ghec_v2022_11_28/types/group_0525.py @@ -34,7 +34,7 @@ class WebhooksAnswerType(TypedDict): html_url: str id: int node_id: str - parent_id: None + parent_id: Union[int, None] reactions: NotRequired[WebhooksAnswerPropReactionsType] repository_url: str updated_at: datetime diff --git a/githubkit/versions/v2022_11_28/models/group_0458.py b/githubkit/versions/v2022_11_28/models/group_0458.py index ff2aa46c5..29b321ff4 100644 --- a/githubkit/versions/v2022_11_28/models/group_0458.py +++ b/githubkit/versions/v2022_11_28/models/group_0458.py @@ -42,7 +42,7 @@ class WebhooksAnswer(GitHubModel): html_url: str = Field() id: int = Field() node_id: str = Field() - parent_id: None = Field() + parent_id: Union[int, None] = Field() reactions: Missing[WebhooksAnswerPropReactions] = Field( default=UNSET, title="Reactions" ) diff --git a/githubkit/versions/v2022_11_28/types/group_0458.py b/githubkit/versions/v2022_11_28/types/group_0458.py index 32906747e..15c8ec597 100644 --- a/githubkit/versions/v2022_11_28/types/group_0458.py +++ b/githubkit/versions/v2022_11_28/types/group_0458.py @@ -34,7 +34,7 @@ class WebhooksAnswerType(TypedDict): html_url: str id: int node_id: str - parent_id: None + parent_id: Union[int, None] reactions: NotRequired[WebhooksAnswerPropReactionsType] repository_url: str updated_at: datetime diff --git a/githubkit/versions/versions.lock b/githubkit/versions/versions.lock index 357212b0e..1ef47234a 100644 --- a/githubkit/versions/versions.lock +++ b/githubkit/versions/versions.lock @@ -141,6 +141,7 @@ source = "https://raw.githubusercontent.com/github/rest-api-description/dee4dc2b "/components/schemas/webhook-workflow-run-requested/properties/workflow_run/properties/pull_requests/items/properties/id" = {type = "integer"} "/components/schemas/webhook-workflow-run-requested/properties/workflow_run/properties/pull_requests/items/properties/number" = {type = "integer"} "/webhooks/repository-dispatch-sample.collected/post" = {operationId = "repository-dispatch"} +"/components/schemas/webhooks_answer/properties/parent_id" = {type = ["integer", "null"]} "/components/schemas/dependabot-alert-with-repository/properties/dependency/properties/relationship/enum" = {"" = ["inconclusive"]} "/components/schemas/code-scanning-alert-classification/enum" = {"" = ["documentation"]} diff --git a/pyproject.toml b/pyproject.toml index 765832fe5..ee18edcc2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -549,6 +549,13 @@ source = "descriptions-next/ghec/ghec.2022-11-28.json" "/webhooks/repository-dispatch-sample.collected/post" = { operationId = "repository-dispatch" } # "/components/schemas/webhook-repository-dispatch-sample/properties/action" = { enum = "" } +# https://github.com/yanyongyu/githubkit/issues/239 +# discussion answer's parent id may be not null +"/components/schemas/webhooks_answer/properties/parent_id" = { type = [ + "integer", + "null", +] } + # https://github.com/yanyongyu/githubkit/issues/205 # https://github.com/github/rest-api-description/issues/4727 "/components/schemas/dependabot-alert-with-repository/properties/dependency/properties/relationship/enum" = { "" = [