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

Definition of WebhookPayloadPullRequestPullRequest and WebhookPayloadPullRequestReviewPullRequest has a few Array<any> #293

Closed
christophehurpeau opened this issue Oct 4, 2020 · 2 comments · Fixed by #296
Labels
Type: Bug Something isn't working as documented, or is being fixed typescript Relevant to TypeScript users only

Comments

@christophehurpeau
Copy link

christophehurpeau commented Oct 4, 2020

Hello,

In WebhookPayloadPullRequestReviewPullRequest these fields are defined as Array<any>

  • assignees
  • requested_reviewers
  • requested_teams
  • labels
type WebhookPayloadPullRequestReviewPullRequest = {
        url: string;
        id: number;
        node_id: string;
        html_url: string;
        diff_url: string;
        patch_url: string;
        issue_url: string;
        number: number;
        state: string;
        locked: boolean;
        title: string;
        user: WebhookPayloadPullRequestReviewPullRequestUser;
        body: string;
        created_at: string;
        updated_at: string;
        closed_at: null;
        merged_at: null;
        merge_commit_sha: string;
        assignee: null;
        assignees: Array<any>;
        requested_reviewers: Array<any>;
        requested_teams: Array<any>;
        labels: Array<any>;
        milestone: null;
        commits_url: string;
        review_comments_url: string;
        review_comment_url: string;
        comments_url: string;
        statuses_url: string;
        head: WebhookPayloadPullRequestReviewPullRequestHead;
        base: WebhookPayloadPullRequestReviewPullRequestBase;
        _links: WebhookPayloadPullRequestReviewPullRequestLinks;
        author_association: string;
    };

However there are quite similary to WebhookPayloadPullRequestPullRequest which does type them better for assignees and labels:

        assignees: Array<WebhookPayloadPullRequestPullRequestAssigneesItem>;
        requested_reviewers: Array<any>;
        requested_teams: Array<any>;
        labels: Array<WebhookPayloadPullRequestPullRequestLabelsItem>;

Would it be possible to fix them ?

@wolfy1339 wolfy1339 added the typescript Relevant to TypeScript users only label Oct 4, 2020
@wolfy1339
Copy link
Member

Hey Christophe 👋,

Thanks for bringing this to our attention. This is unfortunately a known problem for many of the different payload definitions.

The TS definitions are auto-generated from the octokit/webhooks repository.

I believe this issue affects more than just that specific definition. It shouldn't be very hard to fix and would be included in a future release of this library.

If you want to help out and fix this, you can view this pull request to help guide you on what files you need to change.

@wolfy1339 wolfy1339 added the Type: Bug Something isn't working as documented, or is being fixed label Oct 4, 2020
@christophehurpeau
Copy link
Author

Thanks ! I'll try to make a PR when I'll have some time :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Something isn't working as documented, or is being fixed typescript Relevant to TypeScript users only
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants