[Schema Inaccuracy] example seemingly used as a pseudo-discriminator
@nickfloyd がすでに取り組んでいます。
2025年11月6日 から。
評価
この issue はまだ評価されていません。
説明
.components.schemas.environment.properties.protection_rules (and some other places I think) is defined as:
"anyOf": [
{
"type": "object",
"properties": {
"id": { "type": "integer", "example": 3515 },
"node_id": { "type": "string", "example": "MDQ6R2F0ZTM1MTU=" },
"type": { "type": "string", "example": "wait_timer" },
"wait_timer": { "$ref": "#/components/schemas/wait-timer" }
},
"required": [ "id", "node_id", "type" ]
},
{
"type": "object",
"properties": {
"id": { "type": "integer", "example": 3515 },
"node_id": { "type": "string", "example": "MDQ6R2F0ZTM1MTU=" },
"type": { "type": "string", "example": "required_reviewers" },
"reviewers": { ... }
},
"required": [ "id", "node_id", "type" ]
},
{
"type": "object",
"properties": {
"id": { "type": "integer", "example": 3515 },
"node_id": { "type": "string", "example": "MDQ6R2F0ZTM1MTU=" },
"type": { "type": "string", "example": "branch_policy" }
},
"required": [ "id", "node_id", "type" ]
}
The examples associated with the type property seem to be used as discriminator values (although without that being spelled out explicitely anywhere).
I understand OpenAPIv3 has a discriminator feature for exactly that use case.
- 主要言語
- 言語のデータがありません
- スター
- 1.6k
- フォーク
- 342
- 平均マージ
- 2時間 23分
- マージ済み PR(30日)
- 57
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
github/rest-api-description のほかの issue
-
feature
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
github/rest-api-description#7220 ·
-
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 ·