[Schema Inaccuracy] `permission` on Add a repository collaborator is valid on personal-account repositories
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 85/100
- Loại issue
- Tài liệu
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- openapi
- Lĩnh vực
- api, documentation
Hướng nghiên cứu
Bắt đầu trong descriptions/[api.github.com/], kiểm tra api.github.com.2022-11-28.json và api.github.com.2026-03-10.json cho thao tác Add a repository collaborator. Cập nhật mô tả tham số permission để phân biệt các repository của tài khoản cá nhân và các repository thuộc tổ chức, sau đó xác minh rằng cả hai phiên bản đều nhất quán trong việc ghi lại các giá trị được chấp nhận và các hạn chế.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Schema Inaccuracy
Operation: PUT /repos/{owner}/{repo}/collaborators/{username} (Add a repository
collaborator).
The description of the permission body parameter states:
The permission to grant the collaborator. Only valid on organization-owned repositories.
That restriction does not hold. On a repository owned by a personal account the parameter
is honoured for pull, push and admin. Only triage and maintain are
organization-only.
Expected
The permission parameter description should state that on organization-owned
repositories all of pull, triage, push, maintain, admin and custom repository
roles are accepted, while on repositories owned by a personal account only pull, push
and admin are accepted — triage and maintain return 422 Validation Failed.
Reproduction Steps
Against a private repository owned by a personal account:
$ curl -X PUT
-H "Authorization: Bearer $TOKEN"
-H "Accept: application/vnd.github+json"
-H "X-GitHub-Api-Version: 2022-11-28"
https://api.github.com/repos/OWNER/REPO/collaborators/USERNAME
-d '{"permission":"pull"}'
→ HTTP 201, and the returned invitation object contains "permissions": "read".
Full sweep of all five values, cancelling the invitation between attempts:
| requested | HTTP | recorded permissions |
|---|---|---|
pull |
201 | read |
triage |
422 | Validation Failed |
push |
201 | write |
maintain |
422 | Validation Failed |
admin |
201 | admin |
Identical sweep against a private organization-owned repository, same script and
token: all five accepted and recorded as requested.
Enforcement matches what is recorded: a collaborator granted pull on a private
personal-account repository has git push rejected by the server.
Note on versioning: this description is identical in both published API versions in
descriptions/[api.github.com/](http://api.github.com/) on main — api.github.com.2022-11-28.json and
api.github.com.2026-03-10.json both contain the "Only valid on organization-owned
repositories." sentence verbatim. So this is not a leftover in an older version.
Related documentation issue: github/docs#45537
- Ngôn ngữ chính
- Không có dữ liệu ngôn ngữ
- Star
- 1.6k
- Fork
- 342
- Merge trung bình
- 3 giờ 33 phút
- Pull request đã merge (30 ngày)
- 51
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của github/rest-api-description
-
feature
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
github/rest-api-description#7201 ·
-
feature
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
github/rest-api-description#7163 ·
-
Runner deprecations: registration_deprecates_at is declared on the response but never returned Đang mởfeature
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
github/rest-api-description#7162 ·
-
feature
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
github/rest-api-description#7135 ·
-
feature
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
github/rest-api-description#7111 · 1 bình luận ·
Tất cả issue của github/rest-api-description
Issue tương tự
-
[Bug]: Matrix progress drafts fail with "Matrix runtime not initialized" during tool activity Đang mởbug clawsweeper:linked-pr-open clawsweeper:needs-live-repro clawsweeper:no-new-fix-pr impact:message-loss issue-rating: 🐚 platinum hermit P2 regression
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
AXERA-TECH/ax-llm#77 ·
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
games-on-whales/wolf#509 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100