From 01754f1eb73466a92314a7d3db0e81e44fe943e0 Mon Sep 17 00:00:00 2001 From: Andrea Testino Date: Sun, 29 Jun 2025 14:58:31 -0400 Subject: [PATCH 1/3] fix: remove verified_at from verification schema required fields GitHub's OpenAPI spec incorrectly lists verified_at as a required field in the verification object, but the actual API response doesn't include this field. This causes Pydantic validation errors when parsing commit data with verification information. This fix adds an override to remove verified_at from the required fields list, allowing the models to correctly parse GitHub's actual API responses. --- pyproject.toml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index a26c126dc..5a5fa8df3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "GitHubKit" -version = "0.12.15" +version = "0.12.14" description = "GitHub SDK for Python" authors = ["yanyongyu "] license = "MIT" @@ -21,7 +21,7 @@ pydantic = ">=1.9.1, <3.0.0, !=2.5.0, !=2.5.1" PyJWT = { version = "^2.4.0", extras = ["crypto"], optional = true } [tool.poetry.group.dev.dependencies] -ruff = "^0.12.0" +ruff = "^0.11.0" Jinja2 = "^3.1.2" nonemoji = "^0.1.2" pre-commit = "^4.0.0" @@ -361,6 +361,11 @@ source = "https://raw.githubusercontent.com/github/rest-api-description/main/des # git user date format should be date-time "/components/schemas/git-user/properties/date" = { format = "date-time" } +# Fix: Remove verified_at from verification schema - GitHub API doesn't return this field +# The OpenAPI spec incorrectly lists verified_at as required, but the actual API response +# doesn't include this field, causing Pydantic validation errors +"/components/schemas/verification/required" = { "" = ["verified_at"] } + # 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 = [ From 6854f43e46ef24f16501e0562fe593d3d6f23cb7 Mon Sep 17 00:00:00 2001 From: Ju4tCode <42488585+yanyongyu@users.noreply.github.com> Date: Mon, 30 Jun 2025 11:36:41 +0800 Subject: [PATCH 2/3] Apply suggestions from code review --- pyproject.toml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 5a5fa8df3..cf3661b5e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "GitHubKit" -version = "0.12.14" +version = "0.12.15" description = "GitHub SDK for Python" authors = ["yanyongyu "] license = "MIT" @@ -21,7 +21,7 @@ pydantic = ">=1.9.1, <3.0.0, !=2.5.0, !=2.5.1" PyJWT = { version = "^2.4.0", extras = ["crypto"], optional = true } [tool.poetry.group.dev.dependencies] -ruff = "^0.11.0" +ruff = "^0.12.0" Jinja2 = "^3.1.2" nonemoji = "^0.1.2" pre-commit = "^4.0.0" @@ -361,9 +361,9 @@ source = "https://raw.githubusercontent.com/github/rest-api-description/main/des # git user date format should be date-time "/components/schemas/git-user/properties/date" = { format = "date-time" } -# Fix: Remove verified_at from verification schema - GitHub API doesn't return this field -# The OpenAPI spec incorrectly lists verified_at as required, but the actual API response -# doesn't include this field, causing Pydantic validation errors +# https://github.com/yanyongyu/githubkit/pull/229 +# [The OpenAPI spec incorrectly lists verified_at as required, but the actual API response](https://github.com/github/rest-api-description/issues/4995) +# verified_at should be optional when commit not verified "/components/schemas/verification/required" = { "" = ["verified_at"] } # https://github.com/yanyongyu/githubkit/pull/134 From 6d2ac9ec5b608957b5ccdefb28c767eda87d2946 Mon Sep 17 00:00:00 2001 From: Ju4tCode <42488585+yanyongyu@users.noreply.github.com> Date: Mon, 30 Jun 2025 11:37:46 +0800 Subject: [PATCH 3/3] Update pyproject.toml --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index cf3661b5e..87de0213a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -362,7 +362,7 @@ source = "https://raw.githubusercontent.com/github/rest-api-description/main/des "/components/schemas/git-user/properties/date" = { format = "date-time" } # https://github.com/yanyongyu/githubkit/pull/229 -# [The OpenAPI spec incorrectly lists verified_at as required, but the actual API response](https://github.com/github/rest-api-description/issues/4995) +# https://github.com/github/rest-api-description/issues/4995 # verified_at should be optional when commit not verified "/components/schemas/verification/required" = { "" = ["verified_at"] }