Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
1 task done
danbrakeley opened this issue Oct 27, 2023 · 3 comments
Closed
1 task done
Labels
Status: Blocked Some technical or requirement is blocking the issue Status: Triage This is being looked at and prioritized Type: Bug Something isn't working as documented typescript Relevant to TypeScript users only

Comments

@danbrakeley
Copy link

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
@danbrakeley danbrakeley added Status: Triage This is being looked at and prioritized Type: Bug Something isn't working as documented labels Oct 27, 2023
@github-actions
Copy link

👋 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
Copy link
Contributor

gr2m commented Oct 27, 2023

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?

@gr2m gr2m added Status: Blocked Some technical or requirement is blocking the issue typescript Relevant to TypeScript users only labels Oct 27, 2023
@danbrakeley
Copy link
Author

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!

@github-project-automation github-project-automation bot moved this from 🆕 Triage to ✅ Done in 🧰 Octokit Active Oct 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Blocked Some technical or requirement is blocking the issue Status: Triage This is being looked at and prioritized Type: Bug Something isn't working as documented typescript Relevant to TypeScript users only
Projects
Archived in project
Development

No branches or pull requests

2 participants