github - Github 用户 ID 的数据类型

标签 github github-api

我正在使用 Github 的 API 来使用 https://api.github.com/user 获取用户,给我这样的信息:

{
    "login": "someuser123",
    "id": 1234567,
    "avatar_url": "https://avatars.githubusercontent.com/u/...",
    ...
}

但是 id 字段的数据类型是什么?我似乎在 API 指南中找不到任何相关信息。

最佳答案

Octokit.net codebase 中发现了一些 C# 内容这似乎表明 User id 是一个 32 位整数。从 User 构造函数(id 埋在参数列表的中间):

public User(string avatarUrl, string bio, string blog, int collaborators, string company, DateTimeOffset createdAt, int diskUsage, string email, int followers, int following, bool? hireable, string htmlUrl, int totalPrivateRepos, int id, string location, string login, string name, int ownedPrivateRepos, Plan plan, int privateGists, int publicGists, int publicRepos, string url, bool siteAdmin)

关于github - Github 用户 ID 的数据类型,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34578145/

相关文章:

github - 确定 fork 是否准备好

git - Visual Studio 2019 中的 Cherry Pick 问题

Android 工作室 - Gradle - GitHub repo

github - 如何跟踪 Github API 上的当前关注/取消关注事件?

github - 如何通过 GitHub API 获取 Git 标签中的所有提交

git - 无需克隆即可检索 Github 存储库的最新 git 提交哈希

python - 如何使用 PyGithub 将图像文件上传到 Github?

git - 从 git 恢复特定的提交

github - 在 GitHub 中左键单击 PDF 应该在浏览器中显示它还是下载它?

Git "git config --global user.name"为什么会有这个选项?