Skip to content

[Schema Inaccuracy] alert field of secret scanning alert webhook events have no required fields #4807

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
ebickle opened this issue May 6, 2025 · 0 comments
Labels

Comments

@ebickle
Copy link

ebickle commented May 6, 2025

Schema Inaccuracy

The secret-scanning-alert-webhook schema component, used by the alert field of the webhook-secret-scanning-alert-* webhooks (e.g. webhook-secret-scanning-alert-created, does not have any required fields.

The alert is the subject of the webhook and is never optional. Many of the fields of the alert are primary keys or other required elements, such as number, created_at, updated_at, url, html_url, and many more.

Expected

The alert field of all of the webhook-secret-scanning-alert- webhooks should have required properties.

Reproduction Steps

Discovered by using TypeScript and reviewing the code of the ghec REST API descriptions. Using code, it can be discovered by:

import { webhooks } from '@octokit/openapi-webhooks-types-ghec'

type SecretScanningAlertCreatedEvent = webhooks['secret-scanning-alert-created']['post']['requestBody']['content']['application/json'];

const event: SecretScanningAlertCreatedEvent;
// Review type of event - all fields have a type that includes `| undefined`
@becco becco added the feature label May 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants