Hacktoberfest 2026: die Issues, die Maintainer für den Oktober markiert haben – offen und einsteigerfreundlich. Hacktoberfest-Issues durchsuchen

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

Offen
#368 3 Kommentare 0 Reaktionen 1 zugewiesene Person Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

@nickfloyd arbeitet bereits daran.

Seit 06.11.2025.

Bewertung

Dieses Issue wurde noch nicht bewertet.

Beschreibung

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.

Vorherrschende Sprache
Keine Sprachdaten
Sterne
1.6k
Forks
347
Ø Merge
2 Std. 1 Min.
Gemergte PRs (30 T.)
80

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus github/rest-api-description

Alle Issues in github/rest-api-description

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.