Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

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

Open
#368 3 comments 0 reactions 1 assignee View on GitHub

@nickfloyd is already working on this.

Since Nov 6, 2025.

Assessment

This issue has not been assessed yet.

Description

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.

Dominant language
No language data
Stars
1.6k
Forks
342
Avg merge
2h 23m
Merged PRs (30d)
57

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from github/rest-api-description

All issues in github/rest-api-description

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.