[Schema Inaccuracy] pull-request-review.state and two siblings should be enum, not string
Maintainer thường phản hồi trong vòng 1 ngày
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
- 70/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Ít trao đổi
- Công nghệ
- openapi
- Lĩnh vực
- api
Hướng nghiên cứu
Bắt đầu bằng cách xác định các schema của component pull-request-review.state, timeline-reviewed-event.state và webhooks_review.state, sau đó so sánh chúng với các giá trị API được ghi trong tài liệu và tiền lệ inline webhook-pull-request-review-dismissed.review.state. Được xem là hoàn tất khi schema REST liệt kê năm giá trị viết hoa, còn schema timeline và schema webhook dùng chung liệt kê bốn giá trị submitted-review viết thường.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Schema Inaccuracy
Three schemas type their review state property as a plain string rather than an enum, even though the value is constrained to a documented set.
REST (uppercase values):
components/schemas/pull-request-review.state—{ "type": "string", "example": "CHANGES_REQUESTED" }. Used byGET /repos/{owner}/{repo}/pulls/{pull_number}/reviewsand every other endpoint returning a review.
Event records (lowercase values):
components/schemas/timeline-reviewed-event.state—{ "type": "string", "example": "CHANGES_REQUESTED" }. Returned byGET /repos/{owner}/{repo}/issues/{issue_number}/timeline. Theexamplevalue here is uppercase, but the live API returns lowercase for this surface (see Reproduction below).components/schemas/webhooks_review.state—{ "type": "string" },$ref'd fromwebhook-pull-request-review-submitted.reviewand-edited.review. Webhook payloads deliver lowercase.
The canonical value list is GitHub's own GraphQL PullRequestReviewState enum: APPROVED, CHANGES_REQUESTED, COMMENTED, DISMISSED, PENDING. Prior precedent for citing the GraphQL enum as the source of truth: #74 (author_association), which was resolved by introducing a shared author-association component schema with the enum drawn from the GraphQL CommentAuthorAssociation enum.
Expected
pull-request-review.state (REST) should enumerate the uppercase values the API returns:
"state": {
"type": "string",
"enum": ["APPROVED", "CHANGES_REQUESTED", "COMMENTED", "DISMISSED", "PENDING"],
"example": "CHANGES_REQUESTED"
}
timeline-reviewed-event.state and webhooks_review.state should enumerate the lowercase values these surfaces actually deliver (pending is omitted because reviews don't reach event records or webhook payloads until submitted):
"state": {
"type": "string",
"enum": ["approved", "changes_requested", "commented", "dismissed"]
}
The inline webhook-pull-request-review-dismissed.review.state already declares the enum ["dismissed", "approved", "changes_requested"] directly — precedent for the same fix on webhooks_review.state.
Reproduction Steps
REST pull-request-review.state returns uppercase:
$ curl -s -H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/kubernetes/kubernetes/pulls/90000/reviews \
| jq '[.[].state] | unique'
[
"APPROVED",
"CHANGES_REQUESTED",
"COMMENTED"
]
timeline-reviewed-event.state returns lowercase from the same PR (despite the spec's uppercase example: "CHANGES_REQUESTED"):
$ curl -s -H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/kubernetes/kubernetes/issues/90000/timeline \
| jq -r '[.[] | select(.event == "reviewed") | .state] | unique'
[
"approved",
"changes_requested",
"commented"
]
- Ngôn ngữ chính
- Không có dữ liệu ngôn ngữ
- Star
- 1.6k
- Fork
- 345
- Merge trung bình
- 6 giờ
- Pull request đã merge (30 ngày)
- 82
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc 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
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
github/rest-api-description#7266 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
feature
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
github/rest-api-description#7246 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
feature
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
github/rest-api-description#7220 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
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 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
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 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của github/rest-api-description
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
raullenchai/Rapid-MLX#4037 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
diegosouzapw/OmniRoute#15401 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
company delete fails with 500 on any company that has activity (cost events, inbox dismissals)Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
paperclipai/paperclip#14982 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
cbor
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
FasterXML/jackson-dataformats-binary#844 ·
Maintainer thường phản hồi trong vòng 1 ngày