Inconsistent usage of 'select' OData system query option
還沒有人認領這個 Issue。
評估
研究方向
在 Developer Graph Explorer 中以及透過 Python msgraph SDK 重現該要求,重點關注 items 和 items/{id}/versions 端點。追蹤 SDK 如何序列化 OData 系統查詢選項,並將使用 '$select' 的要求與文件所述的行為進行比較。當有效的 list-items 和 versions 回應能夠與 '$select' 及 '$expand' 一起正常運作時,即表示完成。
由索引模型根據 Issue 內容生成。
描述
Describe the bug
When I query the SharePoint API using 'expand' and 'select' query options, the API expects 'select' and not '$select'.
This is not a huge problem as I can easily change my query params to use 'select', however we cannot use the Python msgraph SDK as it always converts the special system query options with a $ prepended.
To Reproduce
Steps to reproduce the behavior:
- Using the Developer Graph Explorer run a query similar to this:
/items$expand=fields&$select=fields/status,lastModifiedDateTime,id
- See error:
{ "error": { "code": "BadRequest", "message": "Parsing OData Select and Expand failed: Found a path with multiple navigation properties or a bad complex property path in a select clause. Please reword your query such that each level of select or expand only contains either TypeSegments or Properties.", "innerError": { "date": "2024-04-09T18:29:12", "request-id": "60cb4f4b-e5f4-48ee-8f1c-981e88440310", "client-request-id": "ed396593-a29f-0d6b-d2d7-d8dc632e4edc" } } }
Workaround
4.Change the '$select' query param to 'select' (without the dollar sign) and you get a valid response.
/items$expand=fields&select=fields/status,lastModifiedDateTime,id
Expected behavior
A valid listitems response from the API using $select
Additional context
This also happens on the items/{id}/versions endpoint
Documentation for OData query options indicates $select as the query param:
https://learn.microsoft.com/en-us/odata/concepts/queryoptions-overview
- 主要語言
- Python
- 星號
- 630
- 分支
- 96
- 平均合併
- 15 小時 20 分鐘
- 30 天內合併 PR
- 3
貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
microsoftgraph/msgraph-sdk-python 的其他 Issue
-
status:waiting-for-triage type:bug
難度 1/5 1 小時以內 新手友好度 90/100
microsoftgraph/msgraph-sdk-python#1570 ·
-
status:waiting-for-triage type:bug
難度 2/5 1-3 小時 新手友好度 75/100
microsoftgraph/msgraph-sdk-python#1563 ·
-
Needs: Attention :wave: type:bug
難度 2/5 1-3 小時 新手友好度 62/100
microsoftgraph/msgraph-sdk-python#1287 · 2 則留言 · 1 個 reaction ·
-
status:waiting-for-triage type:bug
難度 3/5 1-2 天 新手友好度 52/100
microsoftgraph/msgraph-sdk-python#1578 ·
-
status:waiting-for-triage
難度 5/5 一週以上 新手友好度 25/100
microsoftgraph/msgraph-sdk-python#1557 ·
查看 microsoftgraph/msgraph-sdk-python 的全部 Issue
相似的 Issue
-
enhancement
難度 2/5 1-3 小時 新手友好度 70/100
canonical/paas-charm#368 · 1 則留言 ·
-
難度 2/5 1-3 小時 新手友好度 75/100
-
tech debt
難度 2/5 1-3 小時 新手友好度 75/100
-
難度 1/5 1 小時以內 新手友好度 90/100
StevenBlack/hosts#3256 ·
-
難度 1/5 1 小時以內 新手友好度 90/100
qualcomm/qai-appbuilder#275 ·