OpenAPI schema for POST /api/v3/packages does not reflect paginated and polymorphic response
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
- 難度
- 3/5
- 預估耗時
- 1-2 天
- 新手友好度
- 58/100
- Issue 類型
- 缺陷
- 描述清晰度
- 基本清楚
- 活躍度
- 冷清
- 技術堆疊
- openapi, python
研究方向
從 POST /api/v3/packages/ 的 OpenAPI 定義開始,檢查其回應 schema 是如何產生的。驗證文件中的回應是否與實際的 200 分頁結構一致,包括依賴參數的 PURL-string 或 PackageV3 結果,並確認產生的文件或用戶端解析反映了修正後的回應。
由索引模型根據 Issue 內容生成。
描述
The current OpenAPI schema incorrectly documents the response structure of the POST /api/v3/packages/ endpoint.
The schema currently lists a 201 response as a direct mapping to #/components/schemas/PackageV3:
"/api/v3/packages/": {
"post": {
"operationId": "v3_packages_create",
"tags": [
"v3"
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/PackageQuery"
}
},
"application/x-www-form-urlencoded": {
"schema": {
"$ref": "#/components/schemas/PackageQuery"
}
},
"multipart/form-data": {
"schema": {
"$ref": "#/components/schemas/PackageQuery"
}
}
}
},
"security": [
{
"cookieAuth": []
},
{
"tokenAuth": []
},
{}
],
"responses": {
"201": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/PackageV3"
}
}
},
"description": ""
}
}
}
},
However, the actual API response is paginated, and the contents of the results array vary depending on request parameters (such as the details boolean option), so the response can also contain a list of PURL strings, instead of PackageV3 objects.
The response also has an incorrect status code in the schema (actual status code is 200).
This causes automated client generators to fail to parse the actual API responses because they expect a 201 flat object instead of the 200 paginated response structure.
- 主要語言
- Python
- 星號
- 716
- 分支
- 347
- 平均合併
- 12 小時 15 分鐘
- 30 天內合併 PR
- 9
環境準備
- 提供 Dockerfile 或 Docker Compose 檔案
- 沒有 Pull Request 範本
- 沒有貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
aboutcode-org/vulnerablecode 的其他 Issue
-
OSV parser drops all crates.io affected entries because the ecosystem mapping uses cargo可能已有人在做 @Ashutosh-Panda2004 於 2 天前認領。 未關閉
難度 2/5 1-3 小時 新手友好度 76/100
aboutcode-org/vulnerablecode#2485 · 1 則留言 ·
維護者通常 1 天內回覆
-
Docker Compose setup fails on wait-for-it host web:8000 and missing runtime .env可能已有人在做 @Anurag-S1ngh 於 6 天前認領。 未關閉
難度 2/5 半天 新手友好度 77/100
aboutcode-org/vulnerablecode#2477 · 1 則留言 ·
維護者通常 1 天內回覆
-
OVAL parser corrupts version bounds when the epoch is 10, 20 or the version contains "0:"可能已有人在做 @Ashutosh-Panda2004 於 4 天前認領。 未關閉
難度 2/5 1-3 小時 新手友好度 76/100
aboutcode-org/vulnerablecode#2474 · 1 則留言 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 86/100
aboutcode-org/vulnerablecode#2426 ·
維護者通常 1 天內回覆
-
Get NuGet package versions from federated PURL version data in https://github.com/aboutcode-data/可能重新可做 @Anshi321 於 25 天前認領,目前沒有進行中的 PR。 未關閉bug data-quality
難度 2/5 1-3 小時 新手友好度 72/100
aboutcode-org/vulnerablecode#2418 · 4 則留言 ·
維護者通常 1 天內回覆
查看 aboutcode-org/vulnerablecode 的全部 Issue
相似的 Issue
-
bug
難度 1/5 1 小時以內 新手友好度 86/100
awslabs/visual-asset-management-system#937 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 68/100
-
follow-up
難度 2/5 1-3 小時 新手友好度 78/100
維護者通常 1 天內回覆
-
難度 1/5 1 小時以內 新手友好度 83/100
維護者通常 3 天內回覆
-
難度 2/5 1-3 小時 新手友好度 70/100
維護者通常 2 天內回覆