-
Notifications
You must be signed in to change notification settings - Fork 64
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
TypeScript signature of issues.setLabels does not allow correct type of labels attribute. #104
Comments
Thanks @sonnen-athene I was able to reproduce the problem using
this might either be a problem with GitHub's OpenAPI spec that we use to generate the types for the endpoints, or the generated types in https://github.com/octokit/openapi-types.ts. I won't be able to look into this today myself, but will get to it eventually. Can you check the OpenAPI spec? I gut feeling is that there is a |
Thanks for the quick turn around. I'll give those a look and see what I can find out. |
Looks like this is already captured in this issue and isn't caused by this library. Because of that I'll go ahead and close. |
perfect, thank you so much for tracking that down. I'm sorry I forgot about that one |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
🎉 This issue has been resolved in version 18.10.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Checklist
Environment
Versions
What happened?
The params object type for
rest.issues.setLabels
requires thelabels
attribute to be of typestring[] & { name: string; }[]
I have not found a value that allows this type signature to be satisfied, and I think it is incorrect.Minimal test case to reproduce the problem
Causes the following TypeScript error:
The error also occurs when attempting to pass in an array of
{ name: string }
I know that using a string[] is valid, the above code works, it just requires casting the labels to any.
What did you expect to happen?
string[]
to be an allowed type oflabels
attributeWhat the problem might be
The type of
labels
attribute should bestring[] | { name: string; }[]
The text was updated successfully, but these errors were encountered: