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

https://github.com/octokit/types.ts/blob/e7956808d0e1d019c3f6bc7a96d29468dc16ff42/src/generated/Endpoints.ts#L21-L37

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

Most upvoted comments

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.