[Schema Inaccuracy] "Add labels to an issue" requestBody and description incorrect
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 42/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá 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 định nghĩa OpenAPI cho POST /repos/{owner}/{repo}/issues/{issue_number}/labels và so sánh các schema cùng phần mô tả requestBody của định nghĩa đó với hành vi được ghi lại trong issue này. Công việc được xem là hoàn tất khi mô tả endpoint, các dạng được chấp nhận và các ràng buộc minItems phản ánh chính xác hành vi API đã quan sát được.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Schema Inaccuracy
For POST /repos/{owner}/{repo}/issues/{issue_number}/labels, the description is currently
Adds labels to an issue. If you provide an empty array of labels, all labels are removed from the issue.
and the requestBody is documented as
The names of the labels to add to the issue's existing labels. You can pass an empty array to remove all labels. Alternatively, you can pass a single label as a
stringor anarrayof labels directly, but GitHub recommends passing an object with thelabelskey. You can also replace all of the labels for an issue. For more information, see "Set labels for an issue.
and the schema specifies, in effect:
- a lone $string
- an array of $strings
- an array of
{name: $string} - an object with a single property
labelswhose value is an array of strings - an object with a single property
labelswhose value is an array of{name: $string}
incorrect description
First off, the descriptions (of both the endpoint and the requestBody) assert that passing an empty array will remove all the labels, this does not happen, it may have been copied over from the "set labels for an issue" endpoint.
incorrect minItems
On every array, the schema declares minItems: 1, this seems to be untrue for form (2) / (3) which does accept an empty array (it just does nothing), it is true for form 4/5
(1) is not valid
Trying to pass a naked string to the endpoint results in a validation error:
r = session.post(
f'{pr.issue_url}/labels',
json="test",
)
=>
{"message":"Invalid request.\n\nNo subschema in \"anyOf\" matched.\nFor 'anyOf/0', \"test\" is not an array.\nFor 'anyOf/1', \"test\" is not an array.\nFor 'anyOf/2', \"test\" is not an object.","documentation_url":"https://docs.github.com/rest/issues/labels#add-labels-to-an-issue"}
(5) is not valid
Trying to pass a nested record results in a validation error:
r = session.post(
f'{pr.issue_url}/labels',
json={"labels": [{"name": "test"}]},
)
=>
{"message":"Invalid request.\n\nNo subschema in \"anyOf\" matched.\nFor 'anyOf/0', {\"labels\"=>[{\"name\"=>\"test\"}]} is not an array.\nFor 'anyOf/1', {\"labels\"=>[{\"name\"=>\"test\"}]} is not an array.\nFor 'items', {\"name\"=>\"test\"} is not a string.","documentation_url":"https://docs.github.com/rest/issues/labels#add-labels-to-an-issue"}
- 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
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của github/rest-api-description
-
feature
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
github/rest-api-description#7201 ·
-
feature
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
github/rest-api-description#7163 ·
-
Runner deprecations: registration_deprecates_at is declared on the response but never returned Đang mởfeature
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
github/rest-api-description#7162 ·
-
feature
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
github/rest-api-description#7135 ·
-
feature
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
github/rest-api-description#7111 · 1 bình luận ·
Tất cả issue của github/rest-api-description
Issue tương tự
-
area/sessions comp/cron comp/gateway P2 sweeper:risk-message-delivery sweeper:risk-session-state type/bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
NousResearch/hermes-agent#118863 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
use-agent-os/agent-os#3312 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
-
needs-acceptance wg/data-plane-networking
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
vllm-project/semantic-router#4024 · 1 bình luận ·