octokit / openapi-types.ts

Generated TypeScript definitions based on GitHub's OpenAPI spec
MIT License
37 stars 10 forks source link

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

Closed danbrakeley closed 8 months ago

danbrakeley commented 8 months ago

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

github-actions[bot] commented 8 months ago

👋 Hi! Thank you for this contribution! Just to let you know, our GitHub SDK team does a round of issue and PR reviews twice a week, every Monday and Friday! We have a process in place for prioritizing and responding to your input. Because you are a part of this community please feel free to comment, add to, or pick up any issues/PRs that are labled with Status: Up for grabs. You & others like you are the reason all of this works! So thank you & happy coding! 🚀

gr2m commented 8 months ago

The types are generated from GitHub's OpenAPI spec, which is published here: https://github.com/github/rest-api-description/blob/main/descriptions/api.github.com/api.github.com.json

Could you file an issue in that repository and reference this issue there?

danbrakeley commented 8 months ago

Oof, this looks like my bad. I didn't realize that the API docs listed required fields at the bottom of the response schema. With that in mind, the types.d.ts file here does agree with the API docs.

So definitely there is no bug here, so I'm going to close this issue. I will inquire further elsewhere as to if this is the actual intended behavior of this API. Apologies for taking up your time with my mistake/false assumptions!