types.ts: [BUG]: the type `ExtractRequestBody` returns `never`
What happened?
While updating @octoit/plugin-rest-endpoint-methods to use the latest release of this package, in https://github.com/octokit/plugin-rest-endpoint-methods.js/pull/632, the tests are erroring out.
I managed to narrow it down to the ExtractRequestBody type, as can be seen in the code snippet below
Versions
@octokit/types v9.1.2
typescript v5.0.4
Relevant log output
The following error is for the PATCH /repos/{owner}/{repo}/labels/{name} endpoint. Every error is similar to it
Argument of type '{ owner: string; repo: string; name: string; color: string; data: string; }' is not assignable to parameter of type 'RequestParameters & Omit<{ owner: string; repo: string; name: string; } & { data: never; }, "baseUrl" | "headers" | "mediaType">'.
Type '{ owner: string; repo: string; name: string; color: string; data: string; }' is not assignable to type 'Omit<{ owner: string; repo: string; name: string; } & { data: never; }, "baseUrl" | "headers" | "mediaType">'.
Types of property 'data' are incompatible.
Type 'string' is not assignable to type 'never'.
Code of Conduct
- I agree to follow this project’s Code of Conduct
About this issue
- Original URL
- State: closed
- Created a year ago
- Reactions: 1
- Comments: 15 (11 by maintainers)
Commits related to this issue
- fix(types): make all parameters in types required for `ExtractRequestBody<T>` Fixes #528 — committed to octokit/types.ts by wolfy1339 a year ago
- fix(types): make all parameters in types required for `ExtractRequestBody<T>` (#529) Fixes #528 — committed to octokit/types.ts by wolfy1339 a year ago
- fix(types): regenerate the `endpoints.ts` file (#532) Relates to #528 — committed to octokit/types.ts by nickfloyd a year ago
Some clarifications,
It is true that that file is generated and overwritten each time the openapi spec changes. The generation happens using the template file I edited.
Because I edited the template, every time the file is regenerated, the changes will still be present.
So it appears that generation never happened (for whatever reason) so when this got merged in, this was never updated. I’m trying to determine why now.