Fix: remove verified_at from verification schema required fields #229
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
📝 Description
This PR fixes a Pydantic validation error that occurs when fetching full commit details with verification information. The issue arises because GitHub's OpenAPI specification incorrectly lists
verified_at
as a required field in the verification object, but GitHub's actual API response doesn't include this field.The Problem
When using GitHubKit to fetch full commit details (particularly for commits with GPG/signature verification), the library throws a validation error:
Why This Bug Only Appears in Certain Cases
This bug specifically affects endpoints that return full commit details with verification information. Most GitHub operations work with simplified commit objects that don't include the verification field:
The verification object is only included when:
/repos/{owner}/{repo}/commits/{ref}
/repos/{owner}/{repo}/git/commits/{commit_sha}
This explains why the bug may not have been discovered earlier - most common operations (listing commits, PR data, etc.) use simplified commit objects without verification details.
OpenAPI Spec Issue
The OpenAPI spec at https://raw.githubusercontent.com/github/rest-api-description/main/descriptions-next/api.github.com/api.github.com.2022-11-28.json incorrectly defines:
The
verified_at
field is listed in therequired
array but isn't actually returned by the API.We have reported this issue to the GitHub REST API description repository: Schema Inaccuracy: verification.verified_at marked as required but not present in API response #4995
🔗 Related Issue(s)
✔️ Type of Change
🎯 Key Changes & Implementation Details
pyproject.toml
to removeverified_at
from the required fields in the verification schema🧪 Testing Done
verified_at
verified_at
from required fields allows successful parsingReproduction Steps
Use GitHubKit to fetch a commit with full details:
The request fails with:
Note: This only happens for commits that have verification information. Commits without GPG signatures work fine.
✅ Checklist
pre-commit run -a
).release-notes.md
with a summary of my changes under the appropriate version (if applicable, for significant user-facing changes or bug fixes).