Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

[Schema Inaccuracy] example seemingly used as a pseudo-discriminator

未关闭
#368 3 条评论 0 个 reaction 已指派 1 人 在 GitHub 查看

@nickfloyd 已经在做这个了。

开始于 2025年11月6日。

评估

这个 Issue 还没有评估数据。

描述

feature inaccuracy P4

.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 分钟
30 天内合并 PR
57

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

github/rest-api-description 的其他 Issue

查看 github/rest-api-description 的全部 Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。