Where are the JSON schemas for webhook event payloads? #61453
Replies: 2 comments
-
You can find GitHub's REST and Webhook schemas in GitHub's OpenAPI. You want the rest-api-description repository. In particular the file you're looking for is named The JSON file is around 11M and you have to pull it down in raw format. You can also download it using
If you want only the JSON schema, extract it with
There are some weird things in the schema such as |
Beta Was this translation helpful? Give feedback.
-
🕒 Discussion Activity Reminder 🕒 This Discussion has been labeled as dormant by an automated system for having no activity in the last 60 days. Please consider one the following actions: 1️⃣ Close as Out of Date: If the topic is no longer relevant, close the Discussion as 2️⃣ Provide More Information: Share additional details or context — or let the community know if you've found a solution on your own. 3️⃣ Mark a Reply as Answer: If your question has been answered by a reply, mark the most helpful reply as the solution. Note: This dormant notification will only apply to Discussions with the Thank you for helping bring this Discussion to a resolution! 💬 |
Beta Was this translation helpful? Give feedback.
-
Select Topic Area
Question
Body
Hello,
The question is pretty much the title. Where the REST API seems to have versioning and the response schema included in the documentation (take the "Get Repository" endpoint for example), it seems that the documentation for webhook events do not have any JSON schema attached (using the
push
event as example).Having the schema for those payloads would ease a lot the generation of matching types in programming languages to help developing webhook handlers. Did I miss the location to find the schemas? It also seems that the payloads are all different:
commits
array don't have asha
key but anid
one. Is that the same thing? And the timestamp of the commit is incommits[]["timestamp"]
commits
array have asha
key, and they don't have a timestamp at all,commit
has asha
key, but here there are 2 timestamps (for the date of changes and the date of commit) undercommit.(author|committer).date
The discrepancies make it a little hard to find what to expect from the typical payload in the case of webhook apps or other event listeners, so it would be nice to have a schema/spec for those payloads just like what's done for the REST (and probably GraphQL) APIs.
Cheers,
Gerry
Loosely related to XAMPPRocky/octocrab#419
Beta Was this translation helpful? Give feedback.
All reactions