- 
                Notifications
    You must be signed in to change notification settings 
- Fork 35
Closed
Labels
Status: BlockedBlocked by GitHub's API or other external factorsBlocked by GitHub's API or other external factorsType: BugSomething isn't working as documented, or is being fixedSomething isn't working as documented, or is being fixedtypescriptRelevant to TypeScript users onlyRelevant to TypeScript users only
Description
How to recreate the issue
Exactly same issues as: #274
Create a test project:
npm init -y && npm install typescript @octokit/typesGenerates this package.json file:
{
  "name": "test-repo",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "dependencies": {
    "@octokit/types": "^6.11.0",
    "typescript": "^4.2.2"
  }
}Create test.ts:
import { Endpoints } from '@octokit/types'
type listUserReposParameters = Endpoints['PATCH /repos/{owner}/{repo}/check-runs/{check_run_id}']['parameters']
const test: listUserReposParameters = {
    name: '',
    head_sha: '',
    owner: '',
    repo: '',
    status: 'completed'
}./node_modules/.bin/tsc test.tsGives the following error and the type that it constructed seems very broken:
test.ts:10:5 - error TS2322: Type 'string' is not assignable to type 'never'.
10     status: 'completed'
       ~~~~~~
  node_modules/@octokit/openapi-types/dist-types/generated/types.d.ts:19876:21
    19876                     status?: "completed";
                              ~~~~~~
    The expected type comes from property 'status' which is declared here on type '{ owner: string; repo: string; check_run_id: number; } & Partial<{ status?: "completed"; } & { [key: string]: any; }> & Partial<{ status?: "queued" | "in_progress"; } & { [key: string]: any; }> & { ...; }'
Found 1 error.
Trying with v6.3.2 works:
npm install @octokit/[email protected]tsc test.tsDiff is here:
v6.3.2...v6.4.0
gr2m and jamacku
Metadata
Metadata
Assignees
Labels
Status: BlockedBlocked by GitHub's API or other external factorsBlocked by GitHub's API or other external factorsType: BugSomething isn't working as documented, or is being fixedSomething isn't working as documented, or is being fixedtypescriptRelevant to TypeScript users onlyRelevant to TypeScript users only