Giter Club home page Giter Club logo

openapi-types.ts's Introduction

openapi-types.ts

Generated TypeScript definitions based on GitHub's OpenAPI spec

This repository continuously converts GitHub's OpenAPI specification into TypeScript definitions and publishes them to npm as @octokit/openapi-types.

License

MIT

openapi-types.ts's People

Contributors

aarondewes avatar dependabot[bot] avatar gr2m avatar hipstersmoothie avatar jsoref avatar kfcampbell avatar nickfloyd avatar octokitbot avatar oscard0m avatar renovate[bot] avatar timrogers avatar wolfy1339 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

openapi-types.ts's Issues

[BUG]: API docs for Listing Contributors disagrees with types.d.ts

What happened?

The API docs say that when listing contributors, the fields for id, login, avatar_url, etc are not optional (not null or undefined).

However, in this repo's packages/openapi-type/types.d.ts, the contributor fields are all marked as optional:

...
    /**
     * Contributor
     * @description Contributor
     */
    contributor: {
      login?: string;
      id?: number;
      node_id?: string;
      /** Format: uri */
      avatar_url?: string;
...

Versions

I first noticed this in my local copy of @octokit/openapi-types v18.0.0, but when writing this bug report, I looked at the contents of packages/openapi-type/types.d.ts as of commit [d14957b](https://github.com/octokit/openapi-types.ts/commit/d14957b7ce2f4d59f7e39ef054a7bd133606efb6).

Relevant log output

No response

Code of Conduct

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

Pull request's labels have all optional fields

Hello,
I'm not sure if it is the right repo to report it as it seems to be generated from somewhere elese, please point me in another repo if you want me to report it elsewhere !

All label's pull request fields are optional, even the id, it does not seem like they should:

      labels: {
        id?: number;
        node_id?: string;
        url?: string;
        name?: string;
        description?: string;
        color?: string;
        default?: boolean;
      }[];

pull-request-simple: https://github.com/octokit/openapi-types.ts/blob/main/generated/types.ts#L25713-L25721
pull-request: https://github.com/octokit/openapi-types.ts/blob/main/generated/types.ts#L26560-L26568

Thanks

Dependency Dashboard

This issue contains a list of Renovate updates and their statuses.

Awaiting Schedule

These updates are awaiting their schedule. Click on a checkbox to ignore the schedule.

  • fix(deps): lock file maintenance

  • Check this box to trigger a request for Renovate to run again on this repository

Help!!!Type confused!

octokit.rest.repos.updateInformationAboutPagesSite:

octokit.rest.repos.updateInformationAboutPagesSite({
  owner: context.repo.owner,
  repo: context.repo.repo,
  source: { // error error error error error error error error error
    branch: 'branch-foo',
    path: '/',
  },
})

Take a look at the type.d.ts:

{
  // ...
  source?: Partial<'gh-pages' | 'master' | 'master /docs'> &
    Partial<{
      /** The repository branch used to publish your site's source files. */
      branch: string
      /** The repository directory that includes the source files for the Pages site. Allowed paths are `/` or `/docs`. */
      path: '/' | '/docs'
    }>
}

How can I use the source type correctly?

Please re-publish 13.12.0 as 13.13.1

Even though 13.13.0 was removed from npm, it is still in caches and gets picked up.

It is not always possible to reset caches stored in GitHub actions.

[MAINT]: Spelling

Describe the need

typo

SDK Version

No response

API Version

No response

Relevant log output

No response

Code of Conduct

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

Inconsistent status schema components["schemas"]["status"]

The payload for octokit.repos.createCommitStatus for a status is different than the status response from octokit.repos.listCommitStatusesForRef.
octokit.repos.createCommitStatus is string and octokit.repos.createCommitStatus is 'pending' | 'success' | 'failure' | 'error'. `

v3.2.1 broke octokit.repos.createOrUpdateFileContents

It appears that v3.2.1 broke some types in @octokit/rest by upgrading the dependency openapi-typescript to v3. Prior to that version, we called the library like so:

import {Octokit} from '@octokit/rest'

const octokit = new Octokit({auth: '...})

await octokit.repos.createOrUpdateFileContents({
  owner: '...',
  repo: '...',
  path: '...,
  content: '...',
  message: '...,
})

After upgrading @octokit/rest to v3.2.1, that causes the following error:

packages/provisioning-api/src/github.ts:28:50 - error TS2345: Argument of type '{ owner: string; repo: string; path: string; content: string; message: string; }' is not assignable to parameter of type 'RequestParameters & Pick<{ owner: string; repo: string; path: string; } & { data: { "application/json": { message: string; content: string; sha?: string | undefined; branch?: string | undefined; committer?: { ...; } | undefined; author?: { ...; } | undefined; }; }; }, "owner" | ... 2 more ... | "data">'.
  Property 'data' is missing in type '{ owner: string; repo: string; path: string; content: string; message: string; }' but required in type 'Pick<{ owner: string; repo: string; path: string; } & { data: { "application/json": { message: string; content: string; sha?: string | undefined; branch?: string | undefined; committer?: { name: string; email: string; date?: string | undefined; } | undefined; author?: { ...; } | undefined; }; }; }, "owner" | ... 2 m...'.

 28   await octokit.repos.createOrUpdateFileContents({
                                                     ~
 29     owner: '...',
    ~~~~~~~~~~~~~~~~~
...
 33     message: `...`,
    ~~~~~~~~~~~~~~~~~~~
 34   })
    ~~~

  .yarn/cache/@octokit-types-npm-6.5.0-0c84f2cd1e-1bcac38bf1.zip/node_modules/@octokit/types/dist-types/generated/Endpoints.d.ts:10:5
    10     data: {
           ~~~~
    'data' is declared here.

packages/provisioning-api/src/github.ts:45:50 - error TS2345: Argument of type '{ owner: string; repo: string; path: string; content: string; message: string; sha: string; }' is not assignable to parameter of type 'RequestParameters & Pick<{ owner: string; repo: string; path: string; } & { data: { "application/json": { message: string; content: string; sha?: string | undefined; branch?: string | undefined; committer?: { ...; } | undefined; author?: { ...; } | undefined; }; }; }, "owner" | ... 2 more ... | "data">'.
  Property 'data' is missing in type '{ owner: string; repo: string; path: string; content: string; message: string; sha: string; }' but required in type 'Pick<{ owner: string; repo: string; path: string; } & { data: { "application/json": { message: string; content: string; sha?: string | undefined; branch?: string | undefined; committer?: { name: string; email: string; date?: string | undefined; } | undefined; author?: { ...; } | undefined; }; }; }, "owner" | ... 2 m...'.

 45   await octokit.repos.createOrUpdateFileContents({
                                                     ~
 46     owner: '...',
    ~~~~~~~~~~~~~~~~~
...
 51     sha: '...',
    ~~~~~~~~~~~~~~~
 52   })
    ~~~

  .yarn/cache/@octokit-types-npm-6.5.0-0c84f2cd1e-1bcac38bf1.zip/node_modules/@octokit/types/dist-types/generated/Endpoints.d.ts:10:5
    10     data: {
           ~~~~
    'data' is declared here.


Found 2 errors.

It's asking for a data provided with essentially the full request body duplicated. Here's what it wants for data:

{
  data: {
    "application/json": {
      message: string;
      content: string;
      sha?: string;
      branch?: string;
      committer?: {
        name: string;
        email: string;
        date?: string;
      };
      author?: {
        name: string;
        email: string;
        date?: string;
      };
    };
  };
}

I have not determined exactly what the issue is, but something about the types that openapi-typescript v3 is generating is not fully compatible with @octokit/rest.

The automated release is failing 🚨

🚨 The automated release from the main branch failed. 🚨

I recommend you give this issue a high priority, so other packages depending on you can benefit from your bug fixes and new features again.

You can find below the list of errors reported by semantic-release. Each one of them has to be resolved in order to automatically publish your package. I’m sure you can fix this πŸ’ͺ.

Errors are usually caused by a misconfiguration or an authentication problem. With each error reported below you will find explanation and guidance to help you to resolve it.

Once all the errors are resolved, semantic-release will release your package the next time you push a commit to the main branch. You can also manually restart the failed CI job that runs semantic-release.

If you are not sure how to resolve this, here are some links that can help you:

If those don’t help, or if this issue is reporting something you think isn’t right, you can always ask the humans behind semantic-release.


Missing package.json file.

A package.json file at the root of your project is required to release on npm.

Please follow the npm guideline to create a valid package.json file.


Good luck with your project ✨

Your semantic-release bot πŸ“¦πŸš€

Error! This experimental syntax requires enabling one of the following parser plugin(s): 'flow, typescript' (6:7) /home/circleci/project/node_modules/@octokit/openapi-types/generated/types.ts

Description

I've started getting a failing pipeline (something changed upstream it seems) on a project that uses @oktokit/rest package. It started failing about 2 weeks ago.

The error references this package Error! This experimental syntax requires enabling one of the following parser plugin(s): 'flow, typescript' (6:7) /home/circleci/project/node_modules/@octokit/openapi-types/generated/types.ts
I have tried downgrading the version of @oktokit/rest but still seeing the issue, perhaps I can't find the right version at which the package was introduced and many dependencies are not pinned so it is tricky to find.

The package lockfile is not published with you releases so we end up getting whatever is the latest version within the range and I think this is the issue really, would someone be able to confirm?

snyk-api-import@ snyk-api-import
β”œβ”€β”¬ @octokit/[email protected] invalid
β”‚ β”œβ”€β”¬ @octokit/[email protected]
β”‚ β”‚ β”œβ”€β”¬ @octokit/[email protected]
β”‚ β”‚ β”‚ └── @octokit/[email protected] deduped
β”‚ β”‚ β”œβ”€β”¬ @octokit/[email protected]
β”‚ β”‚ β”‚ β”œβ”€β”€ @octokit/[email protected] deduped
β”‚ β”‚ β”‚ β”œβ”€β”€ @octokit/[email protected] deduped
β”‚ β”‚ β”‚ └── [email protected]
β”‚ β”‚ β”œβ”€β”¬ @octokit/[email protected]
β”‚ β”‚ β”‚ β”œβ”€β”¬ @octokit/[email protected]
β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ @octokit/[email protected] deduped
β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ [email protected] deduped
β”‚ β”‚ β”‚ β”‚ └── [email protected]
β”‚ β”‚ β”‚ β”œβ”€β”¬ @octokit/[email protected]
β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ @octokit/[email protected] deduped
β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ [email protected] deduped
β”‚ β”‚ β”‚ β”‚ └── [email protected] deduped
β”‚ β”‚ β”‚ β”œβ”€β”€ @octokit/[email protected] deduped
β”‚ β”‚ β”‚ β”œβ”€β”€ [email protected]
β”‚ β”‚ β”‚ β”œβ”€β”€ [email protected]
β”‚ β”‚ β”‚ β”œβ”€β”€ [email protected]
β”‚ β”‚ β”‚ β”œβ”€β”¬ [email protected]
β”‚ β”‚ β”‚ β”‚ └── [email protected]
β”‚ β”‚ β”‚ └── [email protected]
β”‚ β”‚ β”œβ”€β”¬ @octokit/[email protected]
β”‚ β”‚ β”‚ β”œβ”€β”€ @octokit/[email protected]
β”‚ β”‚ β”‚ └── @types/[email protected] deduped
β”‚ β”‚ β”œβ”€β”€ [email protected]
β”‚ β”‚ └── [email protected]
β”‚ β”œβ”€β”€ @octokit/[email protected] extraneous
β”‚ β”œβ”€β”€ @octokit/[email protected]
β”‚ └── @octokit/[email protected] extraneous
β”œβ”€β”¬ @semantic-release/[email protected]

More info

  • Repo: https://github.com/snyk-tech-services/snyk-api-import
  • Command: npx pkg . -t node12-linux-x64,node12-macos-x64,node12-win-x64
  • This package did not used to be there in the tree (locally I had a lockfile which did not have it and the pkg command succeeded, unfortunately I deleted it to make sure CI and local were in sync it so can't check the versions of the dependencies that last worked :(. Realised too late that I really needed that! And it was ignored in git 🀦 so no backups for me)

Full error

Error! This experimental syntax requires enabling one of the following parser plugin(s): 'flow, typescript' (6:7)
  /home/circleci/project/node_modules/@octokit/openapi-types/generated/types.ts
    at makeError (/home/circleci/project/node_modules/@semantic-release/exec/node_modules/execa/lib/error.js:59:11)
    at handlePromise (/home/circleci/project/node_modules/@semantic-release/exec/node_modules/execa/index.js:114:26)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async module.exports (/home/circleci/project/node_modules/@semantic-release/exec/lib/exec.js:16:11)
    at async prepare (/home/circleci/project/node_modules/@semantic-release/exec/index.js:54:5)
    at async validator (/home/circleci/project/node_modules/semantic-release/lib/plugins/normalize.js:34:24)
    at async /home/circleci/project/node_modules/semantic-release/lib/plugins/pipeline.js:37:34
    at async Promise.all (index 0)
    at async next (/home/circleci/project/node_modules/p-reduce/index.js:16:18) {

[BUG]: Property 'login' does not exist on type 'SerializeObject<UndefinedToOptional<{...}>>

What happened?

After updating Octokit from 2.0.14 to the latest version and running typecheck, I started seeing this error appearing for this code:

const { data: { installations } } = await octokit.rest.apps.listInstallationsForAuthenticatedUser();

installations.map((installation) => installation.account!.login)
Property 'login' does not exist on type 'SerializeObject<UndefinedToOptional<{ name?: string | null | undefined; email?: string | null | undefined; login: string; id: number; node_id: string; avatar_url: string; gravatar_id: string | null; url: string; html_url: string; ... 11 more ...; starred_at?: string | undefined; }>> | SerializeObject<...>'.

Property 'login' does not exist on type 'SerializeObject<UndefinedToOptional<{ description?: string | null | undefined; html_url: string; website_url?: string | null | undefined; id: number; node_id: string; name: string; slug: string; created_at: string | null; updated_at: string | null; avatar_url: string; }>>'

Is there something missing on my side? Or is this a bug? I noticed that the error does not appear if I try to access any of the following properties:

- avatar_url
- html_url
- id
- name?
- node_id

But it does happen for any other property, like description?. I can't seem to figure out if there's a pattern here. This worked fine in previous versions with openapi-types = 16.0.0

I apologize if this is not a bug. Thanks!

Versions

Octokit 3.1.0 with openapi-types on 18.0.0.

Previously, was using Octokit 2.0.14 with openapi-types on 16.0.0.

Relevant log output

No response

Code of Conduct

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

[BUG]: GitHub App Installation DataStructure's account property is missing data fields

What happened?

Upgrading to the latest version of Octokit OpenAPI Types has removed a large number of fields from the account property of the InstallationFunctionOptions type. Previously this property contained the union of both simple-user and enterprise schemas, but the latest version seems to have changed this to only the intersection of the two types.

Latest version snippet from types.d.ts :

installation: {
      /**
       * @description The ID of the installation.
       * @example 1
       */
      id: number;
      account:
        | (
            | components["schemas"]["simple-user"]
            | components["schemas"]["enterprise"]
          )
        | null;
      /**
       * @description Describe whether all repositories have been selected or there's a selection involved
       * @enum {string}
       */
      repository_selection: "all" | "selected";
      /**
       * Format: uri
       * @example https://api.github.com/installations/1/access_tokens
       */
      access_tokens_url: string;
      /**
       * Format: uri
       * @example https://api.github.com/installation/repositories
       */
      repositories_url: string;
      /**
       * Format: uri
       * @example https://github.com/organizations/github/settings/installations/1
       */
      html_url: string;
      /** @example 1 */
      app_id: number;
      /** @description The ID of the user or organization this token is being scoped to. */
      target_id: number;
      /** @example Organization */
      target_type: string;
      permissions: components["schemas"]["app-permissions"];
      events: string[];
      /** Format: date-time */
      created_at: string;
      /** Format: date-time */
      updated_at: string;
      /** @example config.yaml */
      single_file_name: string | null;
      /** @example true */
      has_multiple_single_files?: boolean;
      /**
       * @example [
       *   "config.yml",
       *   ".github/issue_TEMPLATE.md"
       * ]
       */
      single_file_paths?: string[];
      /** @example github-actions */
      app_slug: string;
      suspended_by: components["schemas"]["nullable-simple-user"];
      /** Format: date-time */
      suspended_at: string | null;
      /** @example "[email protected]" */
      contact_email?: string | null;
    };

Previous version :

installation: {
      /**
       * @description The ID of the installation.
       * @example 1
       */
      id: number;
      account:
        | (Partial<components["schemas"]["simple-user"]> &
            Partial<components["schemas"]["enterprise"]>)
        | null;
      /**
       * @description Describe whether all repositories have been selected or there's a selection involved
       * @enum {string}
       */
      repository_selection: "all" | "selected";
      /**
       * Format: uri
       * @example https://api.github.com/installations/1/access_tokens
       */
      access_tokens_url: string;
      /**
       * Format: uri
       * @example https://api.github.com/installation/repositories
       */
      repositories_url: string;
      /**
       * Format: uri
       * @example https://github.com/organizations/github/settings/installations/1
       */
      html_url: string;
      /** @example 1 */
      app_id: number;
      /** @description The ID of the user or organization this token is being scoped to. */
      target_id: number;
      /** @example Organization */
      target_type: string;
      permissions: components["schemas"]["app-permissions"];
      events: string[];
      /** Format: date-time */
      created_at: string;
      /** Format: date-time */
      updated_at: string;
      /** @example config.yaml */
      single_file_name: string | null;
      /** @example true */
      has_multiple_single_files?: boolean;
      /**
       * @example [
       *   "config.yml",
       *   ".github/issue_TEMPLATE.md"
       * ]
       */
      single_file_paths?: string[];
      /** @example github-actions */
      app_slug: string;
      suspended_by: components["schemas"]["nullable-simple-user"];
      /** Format: date-time */
      suspended_at: string | null;
      /** @example "[email protected]" */
      contact_email?: string | null;
    };

Versions

[email protected]
[email protected]

Working OpenAPI-Types : @octokit/[email protected]
Broken OpenAPI-Types : @octokit/[email protected]

Relevant log output

No response

Code of Conduct

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

eslint Unsafe assignment error on users.getByUsername() results

An eslint error occurred after updating to the latest npm release. The change in openapi-types.ts at line 37676 may have introduced an ambiguity that eslint has trouble with. vscode appears to be confused as well. This was found in gitgitgadget dependabot pull request failing. This was referenced in a octokit/rest.js/ comment. The error is:
error Unsafe assignment of an "any" value @typescript-eslint/no-unsafe-assignment

The code compiles okay but gets errors in vscode and eslint. There may be some confusion between 200 and 202 status codes both being successful but this is just a guess.

Action Required: Fix Renovate Configuration

There is an error with this repository's Renovate configuration that needs to be fixed. As a precaution, Renovate will stop PRs until it is resolved.

Location: package.json
Error type: The renovate configuration file contains some invalid settings
Message: Invalid configuration option: @pika/pack, Invalid configuration option: author, Invalid configuration option: keywords, Invalid configuration option: license, Invalid configuration option: main, Invalid configuration option: name, Invalid configuration option: octokit, Invalid configuration option: packageRules[0].@octokit/tsconfig, Invalid configuration option: packageRules[0].@pika/pack, Invalid configuration option: packageRules[0].@pika/plugin-build-node, Invalid configuration option: packageRules[0].@pika/plugin-build-web, Invalid configuration option: packageRules[0].@pika/plugin-ts-standard-pkg, Invalid configuration option: packageRules[0].openapi-typescript, Invalid configuration option: packageRules[0].pika-plugin-merge-properties, Invalid configuration option: packageRules[0].semantic-release-plugin-update-version-in-files, Invalid configuration option: packageRules[0].typescript, Invalid configuration option: publishConfig, Invalid configuration option: release, Invalid configuration option: renovate, Invalid configuration option: scripts, Invalid configuration option: types, Invalid configuration option: version

The types components["schemas"]["check-run"] are not compatible with Github API

Corresponding to https://docs.github.com/en/[email protected]/rest/reference/checks the properties conclusion`` and started_at` are optional values. The API does not allow 'null' value for both of them.

Steps to recreate:

  1. Create a checkrun with queued state and no started or conclusion information.
  2. Update the checkrun to in_progress by using the result object from the 1)
    The result object contains null for conclusion and started_at.
    Due to the type definition it is also not allowed to delete the properties

Expected result: Update request works
Actual result: The update request ends in a http error that say conclusion and started_at cannot be nil.

Include LICENSE file in distributed packages

The generate-types script writes a README.md file that includes a link to the LICENSE file. The LICENSE file isn't written to the package folder though so it's not included in the distributed npm packages and the README references a non-existent file.

Can the license file also be written to each package folder so it gets included in distributed packages?

Invalid types for GET /user/emails

What happened?

Trying to use @octokit/app like this:

const emails = await octokit.request('GET /user/emails');
const isPrimary = emails.data[0].primary;

And according to the docs, this should return:

[
  {
    "email": "[email protected]",
    "verified": true,
    "primary": true,
    "visibility": "public"
  }
]

but TypeScript tells me:

Property 'primary' does not exist on type 'string | { email: string; primary: boolean; verified: boolean; visibility: string; }'.
Property 'primary' does not exist on type 'string'

It seems the type is set to either the email object OR just a string.

I tried to track down where the type i defined, and I think it's here: GitHub's REST API OpenAPI Description, but it looks correct... (line 39539 πŸ˜…)

What did you expect to happen?

I expect the type to match the API docs.

What the problem might be

Not sure where this string gets added unfortunately.

Add types for GHAE and GHES versions

This is not very straight forward.

For one, octokit/openapi just naively transpiles all specs that exist in https://github.com/github/rest-api-description which currently go back to GHES 2.18, but the latest supported GHES version is 2.22. Knowing what the currently supported GHES versions is a recurring problem in @octokit, I had to hard-code it several times, e.g. in https://github.com/octokit/plugin-enterprise-server.js/blob/e8ec2270bd60930a39623195cececea5933070b9/scripts/update-endpoints/ghe-versions.js (which is already out of date, too.)

For now I'll hard code it here so I don't go down yet another rabbit hole, but it is something I have to properly solve now. I'll make a follow up note

The other problem is that each generated TypeScript file is ~1MB big. If we add all the relevant versions to the @octokit/openapi-types package that means 4-5MB extra in download size each time someone installs any octokit package, despite the fact that only a small subset will actually use the types for the enterprise versions.

One approache would be to setup a monorepo like we do in https://github.com/octokit/webhooks. But for that we would also need to remove the current build step, and instead of the TypeScript source code we would generate and publish .d.ts files.

I guess converting this repository from TypeScript + Build Step to .d.ts will be useful anyway, so I might as well start out doing that. Removing the build still will make it much easier to turn this repository into a monorepo for multiple @octokit/openapi-types* repositories

I have to give this some more thought, but here is my current plan

  • #111
  • #114
  • Only publish GHES packages for versions that are currently supported.

[BUG]: Example RSA Private Key triggers Secret Blocker precommit-hook

What happened?

While building a private action, the commit was blocked by our secret blocker.
The secret blocker was triggered by the example RSA Private key in file types.d.ts (line 9570 and 11702).

/** @example "-----BEGIN RSA PRIVATE KEY-----\nMIIEogIB

Versions

@octokit/openapi-types version 22.2.0

installed with

npm install @actions/core
npm install @actions/github

Using node v20.14.0

Relevant log output

No response

Code of Conduct

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

[DOCS]: Add details about the various use cases for the packages published to NPM via this repo

Describe the need

There are questions that come up occasionally about "missing" types when the actual issue is that the consumer needs to use the corresponding platform package - i.e. GHAE, GHES, + all of the corresponding versions.

This behavior is opaque to new users because it requires understanding the various aspects of the GitHub platform and how that translates to the Octokit JS environment.

SDK Version

No response

API Version

No response

Relevant log output

No response

Code of Conduct

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

[BUG]: Missing requestBody properties for checks/create operation

What happened?

The checks/create operation is missing a ton of properties in the requestBody:

"checks/create": {
    parameters: {
      path: {
        owner: components["parameters"]["owner"];
        repo: components["parameters"]["repo"];
      };
    };
    requestBody: {
      content: {
        "application/json": OneOf<
          [
            {
              /** @enum {unknown} */
              status: "completed";
              [key: string]: unknown;
            },
            {
              /** @enum {unknown} */
              status?: "queued" | "in_progress";
              [key: string]: unknown;
            }
          ]
        >;
      };
    };
    responses: {
      /** @description Response */
      201: {
        content: {
          "application/json": components["schemas"]["check-run"];
        };
      };
    };
  };

Looking at the schema here, it looks like it has all the fields. For example, the schema defines name and head_sha as required properties, but they are missing from the type above.

Versions

@octokit/openapi-types v17.1.2

Relevant log output

No response

Code of Conduct

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

`simple-user` component is an enum of the object types and `null`

Blocked by github/rest-api-description#486

    /** Simple User */
    "simple-user": {
      name?: string | null;
      email?: string | null;
      login: string;
      id: number;
      node_id: string;
      avatar_url: string;
      gravatar_id: string | null;
      url: string;
      html_url: string;
      followers_url: string;
      following_url: string;
      gists_url: string;
      starred_url: string;
      subscriptions_url: string;
      organizations_url: string;
      repos_url: string;
      events_url: string;
      received_events_url: string;
      type: string;
      site_admin: boolean;
      starred_at?: string;
    } | null;

I've no idea where the | null comes from

The same is true for these components

  1. simple-user
  2. integration
  3. team-simple
  4. auto_merge
  5. deployment_branch_policy

PushEvent payload data does not exist on types.d.ts

Code:
image

export type GitHubEvent = GetResponseDataTypeFromEndpointMethod<typeof octokit.activity.listPublicEventsForUser>[0];

const iterator = octokit.paginate.iterator(octokit.rest.activity.listPublicEventsForUser, {
  username: user,
  per_page: 100,
})
events = []
for await (const item of iterator) {
  events = this.events.concat(item.data)
}

JsonContent of event object:

"payload": {
  "push_id": 10843997312,
  "size": 1,
  "distinct_size": 1,
  "ref": "refs/heads/master",
  "head": "c73a84db441fdd656d90be5172e41b3eaa69a356",
  "before": "cc3d1a380867a6b30a1520526c4be8f20fc52a69",
  "commits": ...

types.d.ts
image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.