microsoftgraph / microsoftgraph/msgraph-sdk-python

Inconsistent usage of 'select' OData system query option

オープン
#661 コメント 4 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

bug dependency:metadata
主要言語
Python
スター
630
フォーク
96
平均マージ
15時間 20分
マージ済み PR(30日)
3

説明

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:

  1. Using the Developer Graph Explorer run a query similar to this:

/items$expand=fields&$select=fields/status,lastModifiedDateTime,id

  1. 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

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

Developer Graph Explorer と Python msgraph SDK を使ってリクエストを再現し、items と items/{id}/versions エンドポイントに重点を置きます。SDK が OData システムクエリオプションをどのようにシリアライズするかを追跡し、'$select' を使用するリクエストを文書化された動作と比較します。'$select' と '$expand' を併用して、有効な list-items および versions のレスポンスが機能すれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
python
領域
api
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。