GET /user/repos: `homepage` field declared as format "uri" but API returns empty string ""
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
- 62/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Ít trao đổi
- Công nghệ
- openapi
- Lĩnh vực
- api
Hướng nghiên cứu
Xác định schema của repository và định nghĩa homepage của nó, sau đó kiểm tra các schema được GET /user/repos và GET /repos/{owner}/{repo} sử dụng. So sánh ràng buộc URI đã khai báo với các response trong đó homepage là "" và xác thực các schema bị ảnh hưởng; hoàn thành khi các response đó vượt qua xác thực, trong khi các URL homepage hợp lệ vẫn bị ràng buộc.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Description
The repository schema declares the homepage field with format: "uri", but the GitHub API returns an empty string "" for repositories that have no homepage set.
An empty string is not a valid URI per RFC 3986, so MCP servers and other tools that validate API responses against this schema will reject the entire response with a schema validation error.
Error observed
When calling GET /user/repos (or any endpoint returning repository objects), tools that validate against this schema produce:
MCP error -32602: Structured content does not match the tool's output schema:
data/result/23/homepage must match format "uri"
The offending field is homepage: "" — GitHub returns an empty string when no homepage has been set on a repo, rather than null or omitting the field.
Expected behavior
The schema should either:
- Change
homepageto allownullor an empty string alongside valid URIs (e.g.type: ["string", "null"]with theformat: "uri"applied only when non-null/non-empty), or - Document that the API returns
""for unset homepages and update the format constraint accordingly
Steps to reproduce
- Call
GET /user/reposorGET /repos/{owner}/{repo}for any repository that has no homepage URL set in its settings - The response will contain
"homepage": "" - Validating this response against the current OpenAPI schema will fail on the
format: "uri"constraint
Notes
- This affects all repository-returning endpoints, not just
/user/repos - The
homepagefield is likely nullable/optional in practice — the schema should reflect this
- 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 ·