[Schema Inaccuracy] pull-request-review.state and two siblings should be enum, not string
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 70/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 静か
- 技術スタック
- openapi
- 領域
- api
調査の方向性
まずコンポーネントスキーマ pull-request-review.state、timeline-reviewed-event.state、webhooks_review.state を見つけ、ドキュメント化された API の値および inline の webhook-pull-request-review-dismissed.review.state の前例と比較します。REST スキーマに 5 つの大文字の値が列挙され、timeline スキーマと共有 webhook スキーマに 4 つの小文字の submitted-review 値が列挙されていれば完了です。
索引モデルが issue の本文から書いたものです。
説明
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"
]
- 主要言語
- 言語のデータがありません
- スター
- 1.6k
- フォーク
- 342
- 平均マージ
- 3時間 33分
- マージ済み PR(30日)
- 51
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
github/rest-api-description のほかの issue
-
feature
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
github/rest-api-description#7201 ·
-
feature
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
github/rest-api-description#7163 ·
-
feature
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
github/rest-api-description#7162 ·
-
feature
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
github/rest-api-description#7135 ·
-
feature
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
github/rest-api-description#7111 · コメント 1 件 ·
github/rest-api-description の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
syfoud/Simulated_Scepter#172 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 82/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
crossplane/crossplane#7859 ·
-
bot:ai-assisted component:compact-js status:untriaged
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
midnightntwrk/midnight-sdk#403 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
nightscout/nocturne#1379 ·