GitHub 许可证 API returns 有限集
GitHub Licenses API returns a limited set
GitHub API 许可证目前 returns 只有 12 个结果:
$ curl -iG https://api.github.com/licenses
HTTP/1.1 200 OK
Server: GitHub.com
Date: Tue, 05 Jun 2018 04:56:50 GMT
Content-Type: application/json; charset=utf-8
Content-Length: 2325
Status: 200 OK
X-RateLimit-Limit: 60
X-RateLimit-Remaining: 54
X-RateLimit-Reset: 1528176682
Cache-Control: public, max-age=60, s-maxage=60
Vary: Accept
ETag: "732c80ab130b5c627593816bfe032ba3"
X-GitHub-Media-Type: github.v3; format=json
Access-Control-Expose-Headers: ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval
Access-Control-Allow-Origin: *
Strict-Transport-Security: max-age=31536000; includeSubdomains; preload
X-Frame-Options: deny
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Referrer-Policy: origin-when-cross-origin, strict-origin-when-cross-origin
Content-Security-Policy: default-src 'none'
X-Runtime-rack: 0.018674
X-GitHub-Request-Id: 8CD8:1459:19390F:3A5318:5B161811
[
{
"key": "gpl-3.0",
"name": "GNU General Public License v3.0",
"spdx_id": "GPL-3.0",
"url": "https://api.github.com/licenses/gpl-3.0",
"node_id": "MDc6TGljZW5zZTk="
},
{
"key": "gpl-2.0",
"name": "GNU General Public License v2.0",
"spdx_id": "GPL-2.0",
"url": "https://api.github.com/licenses/gpl-2.0",
"node_id": "MDc6TGljZW5zZTg="
},
{
"key": "bsd-2-clause",
"name": "BSD 2-Clause \"Simplified\" License",
"spdx_id": "BSD-2-Clause",
"url": "https://api.github.com/licenses/bsd-2-clause",
"node_id": "MDc6TGljZW5zZTQ="
},
{
"key": "epl-2.0",
"name": "Eclipse Public License 2.0",
"spdx_id": "EPL-2.0",
"url": "https://api.github.com/licenses/epl-2.0",
"node_id": "MDc6TGljZW5zZTMy"
},
{
"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="
},
{
"key": "lgpl-3.0",
"name": "GNU Lesser General Public License v3.0",
"spdx_id": "LGPL-3.0",
"url": "https://api.github.com/licenses/lgpl-3.0",
"node_id": "MDc6TGljZW5zZTEy"
},
{
"key": "bsd-3-clause",
"name": "BSD 3-Clause \"New\" or \"Revised\" License",
"spdx_id": "BSD-3-Clause",
"url": "https://api.github.com/licenses/bsd-3-clause",
"node_id": "MDc6TGljZW5zZTU="
},
{
"key": "lgpl-2.1",
"name": "GNU Lesser General Public License v2.1",
"spdx_id": "LGPL-2.1",
"url": "https://api.github.com/licenses/lgpl-2.1",
"node_id": "MDc6TGljZW5zZTEx"
},
{
"key": "agpl-3.0",
"name": "GNU Affero General Public License v3.0",
"spdx_id": "AGPL-3.0",
"url": "https://api.github.com/licenses/agpl-3.0",
"node_id": "MDc6TGljZW5zZTE="
},
{
"key": "unlicense",
"name": "The Unlicense",
"spdx_id": "Unlicense",
"url": "https://api.github.com/licenses/unlicense",
"node_id": "MDc6TGljZW5zZTE1"
},
{
"key": "mit",
"name": "MIT License",
"spdx_id": "MIT",
"url": "https://api.github.com/licenses/mit",
"node_id": "MDc6TGljZW5zZTEz"
},
{
"key": "mpl-2.0",
"name": "Mozilla Public License 2.0",
"spdx_id": "MPL-2.0",
"url": "https://api.github.com/licenses/mpl-2.0",
"node_id": "MDc6TGljZW5zZTE0"
}
]
页眉中没有指向下一页的链接。所以这似乎是许可证 API 的整个结果集。这是预期的吗?我想找到一种方法从 GitHub 获取所有许可证信息。我看到的唯一其他方法是 get 每个存储库。
Requests that return multiple items will be paginated to 30 items by default.
You can specify further pages with the ?page
parameter. For some resources, you can also set a custom page size up to 100 with the ?per_page
parameter
是的,12 licenses 似乎是完整列表。
这与您在 create a new GitHub repository, by Ryan The Leach
时看到的一致
GitHub API 许可证目前 returns 只有 12 个结果:
$ curl -iG https://api.github.com/licenses
HTTP/1.1 200 OK
Server: GitHub.com
Date: Tue, 05 Jun 2018 04:56:50 GMT
Content-Type: application/json; charset=utf-8
Content-Length: 2325
Status: 200 OK
X-RateLimit-Limit: 60
X-RateLimit-Remaining: 54
X-RateLimit-Reset: 1528176682
Cache-Control: public, max-age=60, s-maxage=60
Vary: Accept
ETag: "732c80ab130b5c627593816bfe032ba3"
X-GitHub-Media-Type: github.v3; format=json
Access-Control-Expose-Headers: ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval
Access-Control-Allow-Origin: *
Strict-Transport-Security: max-age=31536000; includeSubdomains; preload
X-Frame-Options: deny
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Referrer-Policy: origin-when-cross-origin, strict-origin-when-cross-origin
Content-Security-Policy: default-src 'none'
X-Runtime-rack: 0.018674
X-GitHub-Request-Id: 8CD8:1459:19390F:3A5318:5B161811
[
{
"key": "gpl-3.0",
"name": "GNU General Public License v3.0",
"spdx_id": "GPL-3.0",
"url": "https://api.github.com/licenses/gpl-3.0",
"node_id": "MDc6TGljZW5zZTk="
},
{
"key": "gpl-2.0",
"name": "GNU General Public License v2.0",
"spdx_id": "GPL-2.0",
"url": "https://api.github.com/licenses/gpl-2.0",
"node_id": "MDc6TGljZW5zZTg="
},
{
"key": "bsd-2-clause",
"name": "BSD 2-Clause \"Simplified\" License",
"spdx_id": "BSD-2-Clause",
"url": "https://api.github.com/licenses/bsd-2-clause",
"node_id": "MDc6TGljZW5zZTQ="
},
{
"key": "epl-2.0",
"name": "Eclipse Public License 2.0",
"spdx_id": "EPL-2.0",
"url": "https://api.github.com/licenses/epl-2.0",
"node_id": "MDc6TGljZW5zZTMy"
},
{
"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="
},
{
"key": "lgpl-3.0",
"name": "GNU Lesser General Public License v3.0",
"spdx_id": "LGPL-3.0",
"url": "https://api.github.com/licenses/lgpl-3.0",
"node_id": "MDc6TGljZW5zZTEy"
},
{
"key": "bsd-3-clause",
"name": "BSD 3-Clause \"New\" or \"Revised\" License",
"spdx_id": "BSD-3-Clause",
"url": "https://api.github.com/licenses/bsd-3-clause",
"node_id": "MDc6TGljZW5zZTU="
},
{
"key": "lgpl-2.1",
"name": "GNU Lesser General Public License v2.1",
"spdx_id": "LGPL-2.1",
"url": "https://api.github.com/licenses/lgpl-2.1",
"node_id": "MDc6TGljZW5zZTEx"
},
{
"key": "agpl-3.0",
"name": "GNU Affero General Public License v3.0",
"spdx_id": "AGPL-3.0",
"url": "https://api.github.com/licenses/agpl-3.0",
"node_id": "MDc6TGljZW5zZTE="
},
{
"key": "unlicense",
"name": "The Unlicense",
"spdx_id": "Unlicense",
"url": "https://api.github.com/licenses/unlicense",
"node_id": "MDc6TGljZW5zZTE1"
},
{
"key": "mit",
"name": "MIT License",
"spdx_id": "MIT",
"url": "https://api.github.com/licenses/mit",
"node_id": "MDc6TGljZW5zZTEz"
},
{
"key": "mpl-2.0",
"name": "Mozilla Public License 2.0",
"spdx_id": "MPL-2.0",
"url": "https://api.github.com/licenses/mpl-2.0",
"node_id": "MDc6TGljZW5zZTE0"
}
]
页眉中没有指向下一页的链接。所以这似乎是许可证 API 的整个结果集。这是预期的吗?我想找到一种方法从 GitHub 获取所有许可证信息。我看到的唯一其他方法是 get 每个存储库。
Requests that return multiple items will be paginated to 30 items by default.
You can specify further pages with the?page
parameter. For some resources, you can also set a custom page size up to 100 with the?per_page
parameter
是的,12 licenses 似乎是完整列表。
这与您在 create a new GitHub repository,