[Schema Inaccuracy] secret scanning alerts have no required fields

Đang mở
#4,804 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
45/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
openapi, typescript
Lĩnh vực
api

Hướng nghiên cứu

Bắt đầu bằng cách xác định component schema secret-scanning-alert và so sánh các field của nó với các component code-scanning-alertdependabot_alert. Sử dụng bản tái hiện bằng TypeScript với secretScanning.getAlert để xác định field nào luôn được trả về và field nào nên tiếp tục nullable; hoàn thành có nghĩa là schema khai báo các field bắt buộc phù hợp để những giá trị đó không còn được type là có thể undefined.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

feature

Schema Inaccuracy

The secret-scanning-alert schema component does not define any required fields, even though some fields are always present (e.g. primary keys). I can't tell on my end what the full list of fields that should be required are, but some obvious ones include:

  • number - unique ID for the alert
  • created_at
  • updated_at
  • url
  • html_url
  • state
  • secret_type
  • secret_type_display_name
  • secret
  • validity

Some fields are also marked nullable: true, so it's possible all fields are actually required (e.g. returned in a "GetAlert" response) with some being nullable instead.

For comparison, the code-scanning-alert and dependabot_alert (similar APIs also part of GitHub Advanced Security) have required fields.

Expected

The secret-scanning-alert schema component should define required fields.

Reproduction Steps

import { Octokit } from 'octokit';

const octokit = new Octokit({ auth: 'personal-access-token-here' });

const { data: alert } = await octokit.rest.secretScanning.getAlert({
    owner: 'sample-owner', 
    repo: 'sample-repo',
    alert_number: 1234
});

Using TypeScript, review type of fields in alert - they will all include | undefined.

Ngôn ngữ chính
Không có dữ liệu ngôn ngữ
Star
1.6k
Fork
342
Merge trung bình
3 giờ 33 phút
Pull request đã merge (30 ngày)
51

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của github/rest-api-description

Tất cả issue của github/rest-api-description

Issue tương tự

Thêm issue về Backend & API Design

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.