-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG]: types for status codes are wrong #334
Comments
👋 Hi! Thank you for this contribution! Just to let you know, our GitHub SDK team does a round of issue and PR reviews twice a week, every Monday and Friday! We have a process in place for prioritizing and responding to your input. Because you are a part of this community please feel free to comment, add to, or pick up any issues/PRs that are labled with |
Can you please tell us what version of typescript you are using, and what your tsconfig looks like? I can probably have a look at this next week |
Typescript version: 5.1.6 tsconfig:
|
Closing as a duplicate of #188 |
Not exactly the same as #188 |
I have looked into this a little bit, and currently the types cannot handle an empty response for one status code and a body in another. As for 404 status codes, they don't seem to be handled in the types at all |
Glad you decided that it's not a duplicate. 🙂
Yes, after looking into this myself a bit, there's a couple of things:
All of that said, in the case of And overall, it circles back to what I said in my OP - the two function calls I mentioned were just examples of what at least I perceive to be a general problem with non-2xx codes/responses when it comes to types (and possibly docs - which might be subjective). |
What happened?
The types for status codes usually only permit one status code, even though the API docs say differently.
Examples:
pulls.list(...)
,repos.listBranches(...)
(Also: #188 - but that issue is more specific. This is obviously a widespread problem and a general fix would be great.)
Versions
Oktokit v19.0.13
Relevant log output
Code of Conduct
The text was updated successfully, but these errors were encountered: