plugin-rest-endpoint-methods.js icon indicating copy to clipboard operation
plugin-rest-endpoint-methods.js copied to clipboard

[BUG]: `position` marked necessary in `createReview` while it's not

Open bnjbvr opened this issue 2 years ago • 2 comments

What happened?

In the createReview method, the comment's position is marked as necessary according to TypeScript's typings, but the documentation states it's not: https://docs.github.com/en/rest/pulls/reviews?apiVersion=2022-11-28#create-a-review-for-a-pull-request

Versions

  "dependencies": {
    "@actions/core": "^1.2.6",
    "@actions/exec": "^1.0.4",
    "@actions/github": "^4.0.0"
  },
  "devDependencies": {
    "@types/jest": "^26.0.10",
    "@types/node": "^14.6.1",
    "@typescript-eslint/eslint-plugin": "^3.10.1",
    "@typescript-eslint/parser": "^3.10.1",
    "@vercel/ncc": "^0.24.0",
    "eslint": "^7.7.0",
    "eslint-config-sentry": "^1.43.0",
    "eslint-plugin-jest": "^23.20.0",
    "eslint-plugin-prettier": "^3.1.4",
    "husky": "^4.2.5",
    "jest": "^26.4.2",
    "jest-circus": "^26.4.2",
    "js-yaml": "^3.13.1",
    "lint-staged": "^10.2.13",
    "prettier": "^2.1.1",
    "ts-jest": "^26.3.0",
    "typescript": "^4.0.2"
  }

node is v19.5

Relevant log output

src/createReviewCommentsFromPatch.ts:74:7 - error TS2322: Type '{ path: string; body: string; side: string; start_side: string; start_line: number | undefined; line: number; }[]' is not assignable to type 'PullsCreateReviewParamsComments[]'.
  Property 'position' is missing in type '{ path: string; body: string; side: string; start_side: string; start_line: number | undefined; line: number; }' but required in type 'PullsCreateReviewParamsComments'.

74       comments,
         ~~~~~~~~

  node_modules/@octokit/types/dist-types/generated/Endpoints.d.ts:39740:5
    39740     position: number;
              ~~~~~~~~
    'position' is declared here.

Code of Conduct

  • [X] I agree to follow this project's Code of Conduct

bnjbvr avatar Jan 30 '23 17:01 bnjbvr

The types are auto-generated, the issue doesn't lie within this repo.

To get this fixed, file an issue at this repo: https://github.com/github/rest-api-description/ and link back to it here

wolfy1339 avatar Jun 09 '23 19:06 wolfy1339

Hi, is this still an issue with the latest versions of the Octokit libs?

wolfy1339 avatar Apr 16 '24 18:04 wolfy1339