[Schema Inaccuracy] `X-GitHub-Hook-Installation-Target-Type` and `X-GitHub-Hook-Installation-Target-Id` are insufficiently documented (and incorrect)

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

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

Đánh giá

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

Hướng nghiên cứu

Bắt đầu với hai mục schema header webhook được đưa vào issue này và so sánh chúng với tài liệu delivery-headers được liên kết cùng các báo cáo trước đây. Xác minh các giá trị Target-Type hợp lệ và ánh xạ Target-Id cho từng mục, sau đó cập nhật các kiểu và mô tả của schema để các giá trị và mã định danh được tài liệu hóa là chính xác.

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 schema for these two webhook headers only specifies:

          {
            "name": "X-Github-Hook-Installation-Target-Id",
            "in": "header",
            "example": 123123,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Github-Hook-Installation-Target-Type",
            "in": "header",
            "example": "repository",
            "schema": {
              "type": "string"
            }
          },

the webhooks documentation is not significantly more helpful:

X-GitHub-Hook-Installation-Target-Type: The type of resource where the webhook was created.
X-GitHub-Hook-Installation-Target-ID: The unique identifier of the resource where the webhook was created.

Issue

While some hooks can be distinguished by probing the payload for optional entries like installation or organization entries, not only is this pretty ugly some events don't have such entries because e.g. they're not attached to installations in the case of github apps hooks (ping, github_app_authorization.revoked).

Currently every developer who needs this information has to reverse-engineer the values and hope they didn't miss special cases.

Expected

  • enumerate the valid values for Target-Type (as far as I can tell there's repository for repository hooks and integration for app hooks, I have never tested org hooks so I've no idea what that uses
  • specify what Target-Id maps to for each type, as far as I can tell for repository it's the repository id and for integration it's the app id
  • also the Target-Id is currently typed as a string, but all of them are numbers (/ integers)

Previous reports

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.