Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

[Schema Inaccuracy] code_scanning_alert reopened webhook: dismissed_by typed as empty object {} instead of simple-user

Aperta Adatta ai principianti
#6,107 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
68/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
openapi
Ambito
api

Direzione di ricerca

Inizia individuando lo schema del webhook code_scanning_alert per l'azione reopened e confronta la sua definizione di dismissed_by con le altre varianti dell'azione e le correzioni in #6058 e #6081. Il lavoro è completato quando dismissed_by fa riferimento a simple-user o null e i client generati mantengono campi utente come login.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

feature

Expected

In the code_scanning_alert webhook event with action: "reopened", the alert.dismissed_by property should reference the simple-user schema (or be null), consistent with every other action variant that includes a dismissed_by field:

  • appeared_in_branchdismissed_by is simple-user | null
  • closed_by_userdismissed_by is simple-user | null
  • fixeddismissed_by is simple-user | null
  • updated_assignmentdismissed_by is simple-user | null

The dismissed_by field on the reopened action's alert object should match this pattern:

dismissed_by:
  oneOf:
    - $ref: '#/components/schemas/simple-user'
    - type: 'null'

Actual

The webhook schema for code_scanning_alert (action reopened) defines dismissed_by as an empty object {} with no properties. When GitHub delivers this webhook for an alert that was previously dismissed before being reopened, the dismissed_by field contains a full user object (with login, id, etc.), but the schema describes it as an empty object.

Generated clients (e.g. githubkit) produce a model with zero fields — the Pydantic extra="ignore" default silently drops all incoming properties, leaving an empty model instance. Any access to .login then raises AttributeError.

Reproduction Steps

  1. Configure a repository webhook (or GitHub App) to receive code_scanning_alert events.
  2. Dismiss a code scanning alert via the GitHub UI (this populates dismissed_by with the dismissing user).
  3. Reopen the same alert (e.g., via the GitHub UI or API), triggering a code_scanning_alert webhook with action: "reopened".
  4. Inspect the webhook payload. The alert.dismissed_by field contains a full user object, e.g. {"login": "octocat", "id": 1, ...}.
  5. Attempt to validate this payload against a client generated from the OpenAPI spec. The dismissed_by model is empty — all fields are silently dropped and .login is inaccessible.

Impact

Any strongly-typed client generated from this spec (e.g., githubkit for Python, Octokit for TypeScript) will silently produce an empty dismissed_by model instead of a usable user object. Accessing standard user fields like .login raises AttributeError at runtime.

Note: the companion reopened_by_user action correctly types dismissed_by as null (since a user-reopened alert will never have a dismissed_by). The generic reopened action is the only variant where this schema error exists.

Reference

Lingua principale
Nessun dato sulla lingua
Stelle
1.6k
Fork
342
Merge medio
2h 23m
PR unite (30g)
57

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di github/rest-api-description

Tutte le issue di github/rest-api-description

Issue simili

Altre issue su Backend & API Design

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.