[Schema Inaccuracy] code_scanning_alert fixed webhook: alert.state typed as null | "fixed" but GitHub sends "dismissed"
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 64/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Tranquilla
- Stack tecnologico
- openapi
- Ambito
- api
Direzione di ricerca
Individua lo schema OpenAPI per il webhook code_scanning_alert con l'azione "fixed". Confronta la relativa definizione di alert.state con le azioni appeared_in_branch, reopened e updated_assignment, quindi aggiorna lo schema in modo che vengano accettati payload dismissed validi. Convalida la specifica modificata usando l'esempio del webhook o i controlli dello schema disponibili nel repository.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Expected
In the code_scanning_alert webhook event with action: "fixed", the alert.state property should permit "dismissed" in addition to null and "fixed":
state:
description: >-
State of a code scanning alert. Events for alerts found outside the
default branch will return a `null` value until they are dismissed or
fixed.
oneOf:
- type: "null"
- enum:
- fixed
- dismissed
type: string
This would be consistent with how the appeared_in_branch, reopened, and updated_assignment actions already define alert.state as null | "open" | "dismissed" | "fixed".
Actual
The webhook schema for code_scanning_alert (action fixed) defines alert.state as only null | "fixed", rejecting the value "dismissed".
Reproduction Steps
- Configure a repository webhook (or GitHub App) to receive
code_scanning_alertevents. - Have a code scanning alert that has been dismissed (e.g., marked as "won't fix").
- Merge a PR that fixes the underlying code issue for that dismissed alert.
- GitHub delivers a
code_scanning_alertwebhook withaction: "fixed", but thealert.statefield is"dismissed"(not"fixed"), because the alert's canonical state remains dismissed. - Attempt to validate this payload against a client generated from the OpenAPI spec. Validation fails because the schema only permits
nullor"fixed"foralert.state.
Impact
Any strongly-typed client generated from this spec (e.g., githubkit for Python, Octokit for TypeScript) will reject valid code_scanning_alert fixed webhook payloads when the alert was previously dismissed, because "dismissed" does not conform to the null | "fixed" schema.
Error
pydantic_core._pydantic_core.ValidationError: 1 validation error for
tagged-union[...,WebhookCodeScanningAlertFixed,...]
fixed.alert.state
Input should be 'fixed' [type=literal_error, input_value='dismissed', input_type=str]
Reference
- Related spec issue for
fixed_aton the same webhook: https://github.com/github/rest-api-description/issues/6058 - Webhook event docs: https://docs.github.com/en/webhooks/webhook-events-and-payloads#code_scanning_alert
- Lingua principale
- Nessun dato sulla lingua
- Stelle
- 1.6k
- Fork
- 342
- Merge medio
- 3h 33m
- PR unite (30g)
- 51
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di github/rest-api-description
-
feature
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
github/rest-api-description#7201 ·
-
feature
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
github/rest-api-description#7163 ·
-
Runner deprecations: registration_deprecates_at is declared on the response but never returned Apertafeature
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
github/rest-api-description#7162 ·
-
feature
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
github/rest-api-description#7135 ·
-
feature
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
github/rest-api-description#7111 · 1 commento ·
Tutte le issue di github/rest-api-description
Issue simili
-
[Bug]: Matrix progress drafts fail with "Matrix runtime not initialized" during tool activity Apertabug clawsweeper:linked-pr-open clawsweeper:needs-live-repro clawsweeper:no-new-fix-pr impact:message-loss issue-rating: 🐚 platinum hermit P2 regression
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
AXERA-TECH/ax-llm#77 ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
games-on-whales/wolf#509 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100