rest.js
rest.js copied to clipboard
TypeScript: Property 'commits' does not exist on 'payload'
Checklist
- [x] I checked all open bugs and none of them matched my problem.
Environment
- [ ] https://api.github.com
- [ ] GitHub Enterprise Server:
- [ ] GitHub Enterprise Cloud
- [x] Node.js
- [ ] Browsers:
- [x] Others: using Octokit in a TypeScript project
Versions
^18.12.
What happened?
It appears that the package doesn't contain all the required fields on payload.

Repo: https://github.com/jsjoeio/github-email-extension
Minimal test case to reproduce the problem
What did you expect to happen?
I expected to have the types match actual data.
What the problem might be
Types are missing the correct payload structure for PushEvent
NOTES Found this issue with my friend @beraliv
Thanks for this report :+1:
There's nothing we can do on our side. The types are auto-generated from GitHub's OpenAPI spec.
Unfortunately, the JS octokit packages don't have an active maintainer anymore, so we cannot update the types for the REST endpoints.
You can check out this discussion for further updates
Ah bummer! Okay well thank you for the quick update.
Hi @jsjoeio, Is this still an issue for you with the latest updates that have been made to this project?
Hi @wolfy1339 - apologies, I don't really have the time these days to check. Here is where I was having issues: https://github.com/jsjoeio/github-email-extension/blob/master/src/content_script.ts#L110
Otherwise, feel to close
This seems like an issue upstream, the OpenAPI spec isn't complete for this endpoint it seems
We'll need an example of a PushEvent with undocumented properties so we can investigate this on the GitHub side - I've requested that here. If anyone can help, that would be amazing.
It's not that there's undocumented properties on the PushEvent, it's that the property commits isn't defined on the response type of the endpoint
I understand that 😊 It'd just be helpful to have an example JSON response that I can share to demonstrate the problem.