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] Repository Advisory's author and publisher fields

Đang mở
#2,534 2 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ó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
45/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
openapi
Lĩnh vực
api

Hướng nghiên cứu

Bắt đầu bằng cách tìm schema #/components/schemas/repository-advisory trong mô tả OpenAPI và kiểm tra các trường authorpublisher. Kiểm tra cách các quy ước schema của dự án và các công cụ OpenAPI liên quan diễn giải các khai báo allOftype nullable của chúng. Hoàn tất khi cả hai trường đều có biểu diễn hợp lệ, không mơ hồ và hỗ trợ trường hợp sử dụng tạo client đã được báo cáo.

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

Mô tả

feature fundamentals-and-support inaccuracy shield waiting for review

Schema Inaccuracy

Currently, the #/components/schemas/repository-advisory schema has two fields with interesting types:

        author:
          readOnly: true
          description: The author of the advisory.
          allOf:
          - "$ref": "#/components/schemas/simple-user"
          type:
          - 'null'
        publisher:
          readOnly: true
          description: The publisher of the advisory.
          allOf:
          - "$ref": "#/components/schemas/simple-user"
          type:
          - 'null'

This appears to be somewhat contradictory, though it's always possible I'm misunderstanding the intent and the spec. The impact is that I'm currently unable to generate client code using a custom code generator (which, of course, might be wrong).

Expected

I believe the contents of the allOf property should be part of type, creating a nullable union:

        author:
          readOnly: true
          description: The author of the advisory.
          type:
          - "$ref": "#/components/schemas/simple-user"
          - 'null'
        publisher:
          readOnly: true
          description: The publisher of the advisory.
          type:
          - "$ref": "#/components/schemas/simple-user"
          - 'null'

Reproduction Steps

This issue arose while generating code from the description, so no API endpoint calls are involved. The code generator is language-specific, so it's unlikely to be useful during reproduction.

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

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.