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

[Schema Inaccuracy] events schema missing event definitions #1318

Open
wolfy1339 opened this issue Jul 11, 2022 · 7 comments
Open

[Schema Inaccuracy] events schema missing event definitions #1318

wolfy1339 opened this issue Jul 11, 2022 · 7 comments

Comments

@wolfy1339
Copy link

wolfy1339 commented Jul 11, 2022

Schema Inaccuracy

The events schema for GET /users/{username}/events/public is incomplete.
It is missing the PushEvent, and possibly others

Expected

For the schema to include definitions for all possible events from the Event API.

Ideally there should be a separate schema definition for each event, and the event schema is a oneOf of all of those

Reproduction Steps

curl -X GET https://api.github.com/events
curl -X GET https://api.github.com/users/USER/events
curl -X GET https://github.com/users/USER/events/public

ref: octokit/rest.js#128

@timrogers
Copy link
Contributor

@wolfy1339 👋🏻 Thanks for reporting this. Do you have an example of a PushEvent with undocumented payload properties? That will help me to give the right team at GitHub the context they need to investigate this.

@wolfy1339
Copy link
Author

Here are some examples of events, namely PushEvent, CreateEvent, PullRequestReviewEvent, that aren't defined in the current schema

[
  {
    "id": "22832262865",
    "type": "CreateEvent",
    "actor": {
      "id": 31301654,
      "login": "imgbot[bot]",
      "display_login": "imgbot",
      "gravatar_id": "",
      "url": "https://api.github.com/users/imgbot[bot]",
      "avatar_url": "https://avatars.githubusercontent.com/u/31301654?"
    },
    "repo": {
      "id": 187997921,
      "name": "sumaolin/WebGL-Fluid-Simulation",
      "url": "https://api.github.com/repos/sumaolin/WebGL-Fluid-Simulation"
    },
    "payload": {
      "ref": "imgbot",
      "ref_type": "branch",
      "master_branch": "master",
      "description": "Play with fluids in your browser (works even on mobile)",
      "pusher_type": "user"
    },
    "public": true,
    "created_at": "2022-07-12T13:52:25Z"
  },
  {
    "id": "22832262832",
    "type": "PushEvent",
    "actor": {
      "id": 41898282,
      "login": "github-actions[bot]",
      "display_login": "github-actions",
      "gravatar_id": "",
      "url": "https://api.github.com/users/github-actions[bot]",
      "avatar_url": "https://avatars.githubusercontent.com/u/41898282?"
    },
    "repo": {
      "id": 508814462,
      "name": "fmtgomes/fmtgomes",
      "url": "https://api.github.com/repos/fmtgomes/fmtgomes"
    },
    "payload": {
      "push_id": 10416953671,
      "size": 1,
      "distinct_size": 1,
      "ref": "refs/heads/output",
      "head": "0dd802681fcc27f3cd9ac344e812025a9cac8f3b",
      "before": "ae8ceb64a2dc13a5934d41cceff693265e7c9418",
      "commits": [
        {
          "sha": "0dd802681fcc27f3cd9ac344e812025a9cac8f3b",
          "author": {
            "email": "41898282+github-actions[bot]@users.noreply.github.com",
            "name": "github-actions[bot]"
          },
          "message": "Deploy to GitHub pages",
          "distinct": true,
          "url": "https://api.github.com/repos/fmtgomes/fmtgomes/commits/0dd802681fcc27f3cd9ac344e812025a9cac8f3b"
        }
      ]
    },
    "public": true,
    "created_at": "2022-07-12T13:52:25Z"
  },
  {
    "id": "22832262762",
    "type": "PullRequestReviewEvent",
    "actor": {
      "id": 42961061,
      "login": "jumaffre",
      "display_login": "jumaffre",
      "gravatar_id": "",
      "url": "https://api.github.com/users/jumaffre",
      "avatar_url": "https://avatars.githubusercontent.com/u/42961061?"
    },
    "repo": {
      "id": 180112558,
      "name": "microsoft/CCF",
      "url": "https://api.github.com/repos/microsoft/CCF"
    },
    "payload": {
      "action": "created",
      "review": {
        "id": 1035851579,
        "node_id": "PRR_kwDOCrxMrs49vdc7",
        "user": {
          "login": "jumaffre",
          "id": 42961061,
          "node_id": "MDQ6VXNlcjQyOTYxMDYx",
          "avatar_url": "https://avatars.githubusercontent.com/u/42961061?v=4",
          "gravatar_id": "",
          "url": "https://api.github.com/users/jumaffre",
          "html_url": "https://github.com/jumaffre",
          "followers_url": "https://api.github.com/users/jumaffre/followers",
          "following_url": "https://api.github.com/users/jumaffre/following{/other_user}",
          "gists_url": "https://api.github.com/users/jumaffre/gists{/gist_id}",
          "starred_url": "https://api.github.com/users/jumaffre/starred{/owner}{/repo}",
          "subscriptions_url": "https://api.github.com/users/jumaffre/subscriptions",
          "organizations_url": "https://api.github.com/users/jumaffre/orgs",
          "repos_url": "https://api.github.com/users/jumaffre/repos",
          "events_url": "https://api.github.com/users/jumaffre/events{/privacy}",
          "received_events_url": "https://api.github.com/users/jumaffre/received_events",
          "type": "User",
          "site_admin": false
        },
        "body": null,
        "commit_id": "7f102b2f98d73c31437236fe79f1c5f6f72612a9",
        "submitted_at": "2022-07-12T13:52:24Z",
        "state": "commented",
        "html_url": "https://github.com/microsoft/CCF/pull/4010#pullrequestreview-1035851579",
        "pull_request_url": "https://api.github.com/repos/microsoft/CCF/pulls/4010",
        "author_association": "CONTRIBUTOR",
        "_links": {
          "html": {
            "href": "https://github.com/microsoft/CCF/pull/4010#pullrequestreview-1035851579"
          },
          "pull_request": {
            "href": "https://api.github.com/repos/microsoft/CCF/pulls/4010"
          }
        }
      },
      "pull_request": {
        "url": "https://api.github.com/repos/microsoft/CCF/pulls/4010",
        "id": 985102001,
        "node_id": "PR_kwDOCrxMrs46t3ax",
        "html_url": "https://github.com/microsoft/CCF/pull/4010",
        "diff_url": "https://github.com/microsoft/CCF/pull/4010.diff",
        "patch_url": "https://github.com/microsoft/CCF/pull/4010.patch",
        "issue_url": "https://api.github.com/repos/microsoft/CCF/issues/4010",
        "number": 4010,
        "state": "open",
        "locked": false,
        "title": "Add experimental support for HTTP/2",
        "user": {
          "login": "jumaffre",
          "id": 42961061,
          "node_id": "MDQ6VXNlcjQyOTYxMDYx",
          "avatar_url": "https://avatars.githubusercontent.com/u/42961061?v=4",
          "gravatar_id": "",
          "url": "https://api.github.com/users/jumaffre",
          "html_url": "https://github.com/jumaffre",
          "followers_url": "https://api.github.com/users/jumaffre/followers",
          "following_url": "https://api.github.com/users/jumaffre/following{/other_user}",
          "gists_url": "https://api.github.com/users/jumaffre/gists{/gist_id}",
          "starred_url": "https://api.github.com/users/jumaffre/starred{/owner}{/repo}",
          "subscriptions_url": "https://api.github.com/users/jumaffre/subscriptions",
          "organizations_url": "https://api.github.com/users/jumaffre/orgs",
          "repos_url": "https://api.github.com/users/jumaffre/repos",
          "events_url": "https://api.github.com/users/jumaffre/events{/privacy}",
          "received_events_url": "https://api.github.com/users/jumaffre/received_events",
          "type": "User",
          "site_admin": false
        },
        "body": "Part of #3342 \r\n\r\n**Now ready for review.** Thanks @wintersteiger for fixing the memory leaks!\r\n\r\nThis PR adds experimental support for client requests over HTTP/2, which will eventually allow developers to build gRPC applications. The support is very much experimental for now but we have parity with most tests run in the `e2e_logging` end-to-end test (except a few tests that test request forwarding, excluded via the `no_http2()` decorator). \r\n\r\nThe `nghttp2` library now always gets included in the enclave application and a single RPC interface always creates HTTP/2 endpoints if the `app_protocol` configuration entry is set to `HTTP2` (default is `HTTP1`). \r\n\r\nOf course, there's still plenty to do to support HTTP/2 as a first-class protocol (see #3342 for follow-up work) but this PR should have just enough that we can merge this into `main`.\r\n\r\n\r\n",
        "created_at": "2022-07-01T15:40:53Z",
        "updated_at": "2022-07-12T13:52:24Z",
        "closed_at": null,
        "merged_at": null,
        "merge_commit_sha": "c3e0ea6093d14223119dea8432818226e023de72",
        "assignee": null,
        "assignees": [

        ],
        "requested_reviewers": [

        ],
        "requested_teams": [

        ],
        "labels": [

        ],
        "milestone": null,
        "draft": false,
        "commits_url": "https://api.github.com/repos/microsoft/CCF/pulls/4010/commits",
        "review_comments_url": "https://api.github.com/repos/microsoft/CCF/pulls/4010/comments",
        "review_comment_url": "https://api.github.com/repos/microsoft/CCF/pulls/comments{/number}",
        "comments_url": "https://api.github.com/repos/microsoft/CCF/issues/4010/comments",
        "statuses_url": "https://api.github.com/repos/microsoft/CCF/statuses/7f102b2f98d73c31437236fe79f1c5f6f72612a9",
        "head": {
          "label": "jumaffre:http2_playground",
          "ref": "http2_playground",
          "sha": "7f102b2f98d73c31437236fe79f1c5f6f72612a9",
          "user": {
            "login": "jumaffre",
            "id": 42961061,
            "node_id": "MDQ6VXNlcjQyOTYxMDYx",
            "avatar_url": "https://avatars.githubusercontent.com/u/42961061?v=4",
            "gravatar_id": "",
            "url": "https://api.github.com/users/jumaffre",
            "html_url": "https://github.com/jumaffre",
            "followers_url": "https://api.github.com/users/jumaffre/followers",
            "following_url": "https://api.github.com/users/jumaffre/following{/other_user}",
            "gists_url": "https://api.github.com/users/jumaffre/gists{/gist_id}",
            "starred_url": "https://api.github.com/users/jumaffre/starred{/owner}{/repo}",
            "subscriptions_url": "https://api.github.com/users/jumaffre/subscriptions",
            "organizations_url": "https://api.github.com/users/jumaffre/orgs",
            "repos_url": "https://api.github.com/users/jumaffre/repos",
            "events_url": "https://api.github.com/users/jumaffre/events{/privacy}",
            "received_events_url": "https://api.github.com/users/jumaffre/received_events",
            "type": "User",
            "site_admin": false
          },
          "repo": {
            "id": 231363853,
            "node_id": "MDEwOlJlcG9zaXRvcnkyMzEzNjM4NTM=",
            "name": "CCF",
            "full_name": "jumaffre/CCF",
            "private": false,
            "owner": {
              "login": "jumaffre",
              "id": 42961061,
              "node_id": "MDQ6VXNlcjQyOTYxMDYx",
              "avatar_url": "https://avatars.githubusercontent.com/u/42961061?v=4",
              "gravatar_id": "",
              "url": "https://api.github.com/users/jumaffre",
              "html_url": "https://github.com/jumaffre",
              "followers_url": "https://api.github.com/users/jumaffre/followers",
              "following_url": "https://api.github.com/users/jumaffre/following{/other_user}",
              "gists_url": "https://api.github.com/users/jumaffre/gists{/gist_id}",
              "starred_url": "https://api.github.com/users/jumaffre/starred{/owner}{/repo}",
              "subscriptions_url": "https://api.github.com/users/jumaffre/subscriptions",
              "organizations_url": "https://api.github.com/users/jumaffre/orgs",
              "repos_url": "https://api.github.com/users/jumaffre/repos",
              "events_url": "https://api.github.com/users/jumaffre/events{/privacy}",
              "received_events_url": "https://api.github.com/users/jumaffre/received_events",
              "type": "User",
              "site_admin": false
            },
            "html_url": "https://github.com/jumaffre/CCF",
            "description": "Confidential Consortium Framework - a framework to build secure, highly available, and performant applications that focus on multi-party compute and data",
            "fork": true,
            "url": "https://api.github.com/repos/jumaffre/CCF",
            "forks_url": "https://api.github.com/repos/jumaffre/CCF/forks",
            "keys_url": "https://api.github.com/repos/jumaffre/CCF/keys{/key_id}",
            "collaborators_url": "https://api.github.com/repos/jumaffre/CCF/collaborators{/collaborator}",
            "teams_url": "https://api.github.com/repos/jumaffre/CCF/teams",
            "hooks_url": "https://api.github.com/repos/jumaffre/CCF/hooks",
            "issue_events_url": "https://api.github.com/repos/jumaffre/CCF/issues/events{/number}",
            "events_url": "https://api.github.com/repos/jumaffre/CCF/events",
            "assignees_url": "https://api.github.com/repos/jumaffre/CCF/assignees{/user}",
            "branches_url": "https://api.github.com/repos/jumaffre/CCF/branches{/branch}",
            "tags_url": "https://api.github.com/repos/jumaffre/CCF/tags",
            "blobs_url": "https://api.github.com/repos/jumaffre/CCF/git/blobs{/sha}",
            "git_tags_url": "https://api.github.com/repos/jumaffre/CCF/git/tags{/sha}",
            "git_refs_url": "https://api.github.com/repos/jumaffre/CCF/git/refs{/sha}",
            "trees_url": "https://api.github.com/repos/jumaffre/CCF/git/trees{/sha}",
            "statuses_url": "https://api.github.com/repos/jumaffre/CCF/statuses/{sha}",
            "languages_url": "https://api.github.com/repos/jumaffre/CCF/languages",
            "stargazers_url": "https://api.github.com/repos/jumaffre/CCF/stargazers",
            "contributors_url": "https://api.github.com/repos/jumaffre/CCF/contributors",
            "subscribers_url": "https://api.github.com/repos/jumaffre/CCF/subscribers",
            "subscription_url": "https://api.github.com/repos/jumaffre/CCF/subscription",
            "commits_url": "https://api.github.com/repos/jumaffre/CCF/commits{/sha}",
            "git_commits_url": "https://api.github.com/repos/jumaffre/CCF/git/commits{/sha}",
            "comments_url": "https://api.github.com/repos/jumaffre/CCF/comments{/number}",
            "issue_comment_url": "https://api.github.com/repos/jumaffre/CCF/issues/comments{/number}",
            "contents_url": "https://api.github.com/repos/jumaffre/CCF/contents/{+path}",
            "compare_url": "https://api.github.com/repos/jumaffre/CCF/compare/{base}...{head}",
            "merges_url": "https://api.github.com/repos/jumaffre/CCF/merges",
            "archive_url": "https://api.github.com/repos/jumaffre/CCF/{archive_format}{/ref}",
            "downloads_url": "https://api.github.com/repos/jumaffre/CCF/downloads",
            "issues_url": "https://api.github.com/repos/jumaffre/CCF/issues{/number}",
            "pulls_url": "https://api.github.com/repos/jumaffre/CCF/pulls{/number}",
            "milestones_url": "https://api.github.com/repos/jumaffre/CCF/milestones{/number}",
            "notifications_url": "https://api.github.com/repos/jumaffre/CCF/notifications{?since,all,participating}",
            "labels_url": "https://api.github.com/repos/jumaffre/CCF/labels{/name}",
            "releases_url": "https://api.github.com/repos/jumaffre/CCF/releases{/id}",
            "deployments_url": "https://api.github.com/repos/jumaffre/CCF/deployments",
            "created_at": "2020-01-02T11:00:58Z",
            "updated_at": "2022-01-11T00:44:44Z",
            "pushed_at": "2022-07-12T10:43:37Z",
            "git_url": "git://github.com/jumaffre/CCF.git",
            "ssh_url": "git@github.com:jumaffre/CCF.git",
            "clone_url": "https://github.com/jumaffre/CCF.git",
            "svn_url": "https://github.com/jumaffre/CCF",
            "homepage": "https://microsoft.github.io/CCF/",
            "size": 43148,
            "stargazers_count": 0,
            "watchers_count": 0,
            "language": "C++",
            "has_issues": false,
            "has_projects": true,
            "has_downloads": true,
            "has_wiki": false,
            "has_pages": true,
            "forks_count": 0,
            "mirror_url": null,
            "archived": false,
            "disabled": false,
            "open_issues_count": 1,
            "license": {
              "key": "apache-2.0",
              "name": "Apache License 2.0",
              "spdx_id": "Apache-2.0",
              "url": "https://api.github.com/licenses/apache-2.0",
              "node_id": "MDc6TGljZW5zZTI="
            },
            "allow_forking": true,
            "is_template": false,
            "web_commit_signoff_required": false,
            "topics": [

            ],
            "visibility": "public",
            "forks": 0,
            "open_issues": 1,
            "watchers": 0,
            "default_branch": "main"
          }
        },
        "base": {
          "label": "microsoft:main",
          "ref": "main",
          "sha": "b749361f59e18e20ef8a2c38a190229ba2f2b92b",
          "user": {
            "login": "microsoft",
            "id": 6154722,
            "node_id": "MDEyOk9yZ2FuaXphdGlvbjYxNTQ3MjI=",
            "avatar_url": "https://avatars.githubusercontent.com/u/6154722?v=4",
            "gravatar_id": "",
            "url": "https://api.github.com/users/microsoft",
            "html_url": "https://github.com/microsoft",
            "followers_url": "https://api.github.com/users/microsoft/followers",
            "following_url": "https://api.github.com/users/microsoft/following{/other_user}",
            "gists_url": "https://api.github.com/users/microsoft/gists{/gist_id}",
            "starred_url": "https://api.github.com/users/microsoft/starred{/owner}{/repo}",
            "subscriptions_url": "https://api.github.com/users/microsoft/subscriptions",
            "organizations_url": "https://api.github.com/users/microsoft/orgs",
            "repos_url": "https://api.github.com/users/microsoft/repos",
            "events_url": "https://api.github.com/users/microsoft/events{/privacy}",
            "received_events_url": "https://api.github.com/users/microsoft/received_events",
            "type": "Organization",
            "site_admin": false
          },
          "repo": {
            "id": 180112558,
            "node_id": "MDEwOlJlcG9zaXRvcnkxODAxMTI1NTg=",
            "name": "CCF",
            "full_name": "microsoft/CCF",
            "private": false,
            "owner": {
              "login": "microsoft",
              "id": 6154722,
              "node_id": "MDEyOk9yZ2FuaXphdGlvbjYxNTQ3MjI=",
              "avatar_url": "https://avatars.githubusercontent.com/u/6154722?v=4",
              "gravatar_id": "",
              "url": "https://api.github.com/users/microsoft",
              "html_url": "https://github.com/microsoft",
              "followers_url": "https://api.github.com/users/microsoft/followers",
              "following_url": "https://api.github.com/users/microsoft/following{/other_user}",
              "gists_url": "https://api.github.com/users/microsoft/gists{/gist_id}",
              "starred_url": "https://api.github.com/users/microsoft/starred{/owner}{/repo}",
              "subscriptions_url": "https://api.github.com/users/microsoft/subscriptions",
              "organizations_url": "https://api.github.com/users/microsoft/orgs",
              "repos_url": "https://api.github.com/users/microsoft/repos",
              "events_url": "https://api.github.com/users/microsoft/events{/privacy}",
              "received_events_url": "https://api.github.com/users/microsoft/received_events",
              "type": "Organization",
              "site_admin": false
            },
            "html_url": "https://github.com/microsoft/CCF",
            "description": "Confidential Consortium Framework",
            "fork": false,
            "url": "https://api.github.com/repos/microsoft/CCF",
            "forks_url": "https://api.github.com/repos/microsoft/CCF/forks",
            "keys_url": "https://api.github.com/repos/microsoft/CCF/keys{/key_id}",
            "collaborators_url": "https://api.github.com/repos/microsoft/CCF/collaborators{/collaborator}",
            "teams_url": "https://api.github.com/repos/microsoft/CCF/teams",
            "hooks_url": "https://api.github.com/repos/microsoft/CCF/hooks",
            "issue_events_url": "https://api.github.com/repos/microsoft/CCF/issues/events{/number}",
            "events_url": "https://api.github.com/repos/microsoft/CCF/events",
            "assignees_url": "https://api.github.com/repos/microsoft/CCF/assignees{/user}",
            "branches_url": "https://api.github.com/repos/microsoft/CCF/branches{/branch}",
            "tags_url": "https://api.github.com/repos/microsoft/CCF/tags",
            "blobs_url": "https://api.github.com/repos/microsoft/CCF/git/blobs{/sha}",
            "git_tags_url": "https://api.github.com/repos/microsoft/CCF/git/tags{/sha}",
            "git_refs_url": "https://api.github.com/repos/microsoft/CCF/git/refs{/sha}",
            "trees_url": "https://api.github.com/repos/microsoft/CCF/git/trees{/sha}",
            "statuses_url": "https://api.github.com/repos/microsoft/CCF/statuses/{sha}",
            "languages_url": "https://api.github.com/repos/microsoft/CCF/languages",
            "stargazers_url": "https://api.github.com/repos/microsoft/CCF/stargazers",
            "contributors_url": "https://api.github.com/repos/microsoft/CCF/contributors",
            "subscribers_url": "https://api.github.com/repos/microsoft/CCF/subscribers",
            "subscription_url": "https://api.github.com/repos/microsoft/CCF/subscription",
            "commits_url": "https://api.github.com/repos/microsoft/CCF/commits{/sha}",
            "git_commits_url": "https://api.github.com/repos/microsoft/CCF/git/commits{/sha}",
            "comments_url": "https://api.github.com/repos/microsoft/CCF/comments{/number}",
            "issue_comment_url": "https://api.github.com/repos/microsoft/CCF/issues/comments{/number}",
            "contents_url": "https://api.github.com/repos/microsoft/CCF/contents/{+path}",
            "compare_url": "https://api.github.com/repos/microsoft/CCF/compare/{base}...{head}",
            "merges_url": "https://api.github.com/repos/microsoft/CCF/merges",
            "archive_url": "https://api.github.com/repos/microsoft/CCF/{archive_format}{/ref}",
            "downloads_url": "https://api.github.com/repos/microsoft/CCF/downloads",
            "issues_url": "https://api.github.com/repos/microsoft/CCF/issues{/number}",
            "pulls_url": "https://api.github.com/repos/microsoft/CCF/pulls{/number}",
            "milestones_url": "https://api.github.com/repos/microsoft/CCF/milestones{/number}",
            "notifications_url": "https://api.github.com/repos/microsoft/CCF/notifications{?since,all,participating}",
            "labels_url": "https://api.github.com/repos/microsoft/CCF/labels{/name}",
            "releases_url": "https://api.github.com/repos/microsoft/CCF/releases{/id}",
            "deployments_url": "https://api.github.com/repos/microsoft/CCF/deployments",
            "created_at": "2019-04-08T09:13:04Z",
            "updated_at": "2022-07-06T10:02:19Z",
            "pushed_at": "2022-07-12T10:55:41Z",
            "git_url": "git://github.com/microsoft/CCF.git",
            "ssh_url": "git@github.com:microsoft/CCF.git",
            "clone_url": "https://github.com/microsoft/CCF.git",
            "svn_url": "https://github.com/microsoft/CCF",
            "homepage": "https://microsoft.github.io/CCF",
            "size": 225517,
            "stargazers_count": 572,
            "watchers_count": 572,
            "language": "C++",
            "has_issues": true,
            "has_projects": false,
            "has_downloads": true,
            "has_wiki": false,
            "has_pages": true,
            "forks_count": 139,
            "mirror_url": null,
            "archived": false,
            "disabled": false,
            "open_issues_count": 106,
            "license": {
              "key": "apache-2.0",
              "name": "Apache License 2.0",
              "spdx_id": "Apache-2.0",
              "url": "https://api.github.com/licenses/apache-2.0",
              "node_id": "MDc6TGljZW5zZTI="
            },
            "allow_forking": true,
            "is_template": false,
            "web_commit_signoff_required": false,
            "topics": [
              "confidentiality",
              "enclave",
              "framework",
              "integrity",
              "microsoft"
            ],
            "visibility": "public",
            "forks": 139,
            "open_issues": 106,
            "watchers": 572,
            "default_branch": "main"
          }
        },
        "_links": {
          "self": {
            "href": "https://api.github.com/repos/microsoft/CCF/pulls/4010"
          },
          "html": {
            "href": "https://github.com/microsoft/CCF/pull/4010"
          },
          "issue": {
            "href": "https://api.github.com/repos/microsoft/CCF/issues/4010"
          },
          "comments": {
            "href": "https://api.github.com/repos/microsoft/CCF/issues/4010/comments"
          },
          "review_comments": {
            "href": "https://api.github.com/repos/microsoft/CCF/pulls/4010/comments"
          },
          "review_comment": {
            "href": "https://api.github.com/repos/microsoft/CCF/pulls/comments{/number}"
          },
          "commits": {
            "href": "https://api.github.com/repos/microsoft/CCF/pulls/4010/commits"
          },
          "statuses": {
            "href": "https://api.github.com/repos/microsoft/CCF/statuses/7f102b2f98d73c31437236fe79f1c5f6f72612a9"
          }
        },
        "author_association": "CONTRIBUTOR",
        "auto_merge": null,
        "active_lock_reason": null
      }
    },
    "public": true,
    "created_at": "2022-07-12T13:52:25Z",
    "org": {
      "id": 6154722,
      "login": "microsoft",
      "gravatar_id": "",
      "url": "https://api.github.com/orgs/microsoft",
      "avatar_url": "https://avatars.githubusercontent.com/u/6154722?"
    }
  }
]

@wolfy1339 wolfy1339 changed the title [Schema Inaccuracy] GET /users/{username}/events/public missing event definitions [Schema Inaccuracy] events schema missing event definitions Jul 12, 2022
@wolfy1339
Copy link
Author

Ideally there should be a separate schema definition for each event, and the event schema is a oneOf of all of those

@timrogers
Copy link
Contributor

Thanks for the example! I've reported this to the relevant team at GitHub.

@wolfy1339
Copy link
Author

Is there any update to this?

There is also octokit/types.ts#476 that this is blocking

@lmmx
Copy link

lmmx commented Sep 13, 2024

Also interested in this, I haven’t been able to find any models of the schema for the events returned from the activity API, only ‘fixtures’ (test cases), so it seems like noone is able to assert the proper structure of the responses from this API, and software therefore has to make only weak guarantees of what it can parse :/ What a shame

Closest available I have found are these Google-maintained GitHub Go structs: https://github.com/google/go-github/blob/662da6f8e9f32b7da649ad0bfac19948e5acdd85/github/event_types.go

(This was a lucky guess from GitHub searching the most unique event name I could see, PullRequestEvent: https://github.com/search?utf8=%E2%9C%93&q=PullRequestEvent&type=code)

@bhavitsharma
Copy link

It's absolutely insane to me that Github hasn't taken any steps to fix this at all. Billions of dollars in funding and yet they couldn't find time to fix their openapi spec.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants