microsoftgraph / microsoftgraph/msgraph-sdk-python
Python SDK Returning None for All Non-ID Value Fields
まだ誰も着手していません。
- 主要言語
- Python
- スター
- 630
- フォーク
- 96
- 平均マージ
- 15時間 20分
- マージ済み PR(30日)
- 3
説明
Describe the bug
In the Graph Explorer API I can run the following get request:
https://graph.microsoft.com/v1.0/me/memberOf?$search="displayName:{display_name}"&$select=displayName,id
Headers: ConsistencyLevel: eventual, Prefer: legacySearch=false
Below is my version in the Python SDK:
request_config = RequestConfiguration(
options=[ResponseHandlerOption(NativeResponseHandler())]
)
request_config.headers.add("ConsistencyLevel", "eventual")
request_config.headers.add("Prefer", "legacySearch=false")
url = (f'https://graph.microsoft.com/v1.0/me/'
f'memberOf?$search="displayName:{displayName}"&$select=displayName,id')
groups = await (self
.user_client
.me
.with_url(url)
.get(request_config))
groups_data = groups.json()
groups_value = groups_data['value']
return groups_value
Expected behavior
In the Graph API Explorer, I get the following result:
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#directoryObjects(displayName,id)",
"value": [
{
"@odata.type": "#microsoft.graph.group",
"displayName": "{display_name}",
"id": "{group_id}"
}
]
}
In the Python application, I get the following result:
[{'@odata.type': '#microsoft.graph.group', 'displayName': None, 'id': '{group_id}'}]
So basically, in the Python code, I am only getting the ID field value. All other field values of interest such as displayName are returned as None.
Is there some way to alter this code to make the non-ID field values displayable?
How to reproduce
Running the example code above should be sufficient to reproduce this scenario.
SDK Version
1.11.0
Latest version known to work for scenario above?
No response
Known Workarounds
No response
Debug output
Click to expand log
```</details>
### Configuration
_No response_
### Other information
_No response_
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
提供された memberOf リクエストを Python SDK 1.11.0 で実行し、RequestConfiguration、NativeResponseHandler、および with_url().get の呼び出しを含めて、その JSON を Graph Explorer の結果と比較します。まず、レスポンスハンドラーが ID ではないフィールドをどのようにマッピングしているかを追跡します。displayName やその他の選択した値が None として返されず、保持されれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- python
- 領域
- api
- issue の種類
- バグ
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 42/100