UserType discrepancy between enum value and Graph API response
まだ誰も着手していません。
評価
調査の方向性
生成された Microsoft\Graph\Generated\Models\UserType enum から始め、その MEMBER 値を、issue に示されている Microsoft Graph user endpoint のレスポンスと比較します。他の SDK enum 定数についても、同じ種類の不一致がないか確認します。UserType が API と一致し、見つかった追加の不一致がすべて特定されて修正されれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Describe the bug
The following Microsoft Graph API endpoint:
https://graph.microsoft.com/v1.0/users/{{azureUserId}}?$select=userType
returns
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users(userType)/$entity",
"userType": "Member"
}
However, the Microsoft\Graph\Generated\Models\UserType generated enum of the SDK contains
public const MEMBER = "member";
If an integration intends to proactively remove non-member type users from the system using code such as:
if ($azureUser->getUserType() !== UserType::MEMBER) {
$azureUser->delete();
}
this risks removing all Azure users from the system, because an Azure user of user type member would satisfy this condition as well ('member' !== 'Member' is true).
Note: This discrepancy between the API response and the generated SDK has triggered an incident in a production environment of a software product, because the unit tests use the UserType value from the SDK.
Expected behavior
The UserType enum/const should have values capitalized.
Any other enum/consts contained in the SDK should be reviewed for correctness to be in-line with the actual API responses.
How to reproduce
See issue description. There's discrepancy between the API response and the SDK enum/const value.
SDK Version
"microsoft/microsoft-graph": "^2.3",
Latest version known to work for scenario above?
None.
Known Workarounds
Not using UserType, hardcoding sentence-cased value.
Debug output
Click to expand log
```</details>
### Configuration
_No response_
### Other information
_No response_
- 主要言語
- PHP
- スター
- 669
- フォーク
- 149
- 平均マージ
- 1日 4時間
- マージ済み PR(30日)
- 5
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
microsoftgraph/msgraph-sdk-php のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
microsoftgraph/msgraph-sdk-php#1794 · コメント 2 件 ·
-
bug: metadata type:bug
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
microsoftgraph/msgraph-sdk-php#1739 · コメント 6 件 ·
-
status:waiting-for-triage type:bug
難易度 1/5 1時間未満 初心者へのやさしさ 68/100
microsoftgraph/msgraph-sdk-php#1643 · コメント 8 件 · リアクション 4 件 ·
-
status:waiting-for-triage
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
microsoftgraph/msgraph-sdk-php#1800 · リアクション 3 件 ·
-
Nowオープン
難易度 5/5 1週間以上 初心者へのやさしさ 1/100
microsoftgraph/msgraph-sdk-php#1799 ·
microsoftgraph/msgraph-sdk-php の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
matomo-org/plugin-CustomAlerts#310 ·
メンテナーはふだん 1 日以内に返信
-
Bug Status: Needs Triage
難易度 1/5 1時間未満 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
domain/checkout Platform(Default) priority/low testing/acceptance
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
pluginsGLPI/addressing#132 ·
-
5.14.0 PIE packages still declare PHP >=8.3, so PIE installs them on PHP 8.3 and the build failsオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100