Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

[Schema Inaccuracy] Artifact.Id is missing `int64` format

Đang mở Phù hợp với người mới
#7,266 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

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

Đánh giá

Độ khó
1/5
Thời gian dự kiến
Dưới một giờ
Mức phù hợp với người mới
88/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả 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

Mở api.github.com.json và xác định thuộc tính id của đối tượng artifact. Thêm định dạng int64 được hiển thị trong issue, sau đó xác minh rằng schema khiến các client được tạo sử dụng trình giải tuần tự 64 bit thay vì trình giải tuần tự số nguyên.

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

Mô tả

Schema Inaccuracy

When I use Kiota to generate clients for the GitHub API, I get a deserialization error when retreiving artifacts through the API. The value for the Artifact.Id is simply too large and exceeds an Int32.

Expected

It should not result in deserialization errors.

Problem

In the api.github.com.json file, the Actor.Id is defined as:

      "artifact": {
        "title": "Artifact",
        "description": "An artifact",
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "example": 5
          },

This makes Kiota belive that it can use an integer deserializer:

        public virtual IDictionary<string, Action<IParseNode>> GetFieldDeserializers()
        {
            return new Dictionary<string, Action<IParseNode>>
            {
                { "archive_download_url", n => { ArchiveDownloadUrl = n.GetStringValue(); } },
                { "created_at", n => { CreatedAt = n.GetDateTimeOffsetValue(); } },
                { "digest", n => { Digest = n.GetStringValue(); } },
                { "expired", n => { Expired = n.GetBoolValue(); } },
                { "expires_at", n => { ExpiresAt = n.GetDateTimeOffsetValue(); } },
--->            { "id", n => { Id = n.GetIntValue(); } },
                { "name", n => { Name = n.GetStringValue(); } },
                { "node_id", n => { NodeId = n.GetStringValue(); } },
                { "size_in_bytes", n => { SizeInBytes = n.GetIntValue(); } },
                { "updated_at", n => { UpdatedAt = n.GetDateTimeOffsetValue(); } },
                { "url", n => { Url = n.GetStringValue(); } },
                { "workflow_run", n => { WorkflowRun = n.GetObjectValue<global::GitPackagesManager.ApiClient.Models.Artifact_workflow_run>(global::GitPackagesManager.ApiClient.Models.Artifact_workflow_run.CreateFromDiscriminatorValue); } },
            };
        }

If the Artifact.Id had been defined as

      "artifact": {
        "title": "Artifact",
        "description": "An artifact",
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "example": 5,
            "format": "int64"
          },

the 'Id' line in the generated GetFieldDeserializers() method would use n.GetLongValue() instead of n.GetIntValue()

Ngôn ngữ chính
Không có dữ liệu ngôn ngữ
Star
1.6k
Fork
345
Merge trung bình
6 giờ
Pull request đã merge (30 ngày)
82

Chuẩn bị môi trường

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.