[2.0.0-RC13] TransitiveMemberOfRequestBuilder ignoring QueryParameters select
まだ誰も着手していません。
評価
調査の方向性
TransitiveMemberOfRequestBuilder->get() と queryParameters->select の処理から始め、続いてレスポンスが DirectoryObjectCollectionResponse と Group モデルにどのように値を設定するかを追跡します。生成された URL で要求されたフィールドと、wait(); 後に利用可能なフィールドを比較します。選択したプロパティが一貫して返されれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Upon creating a TransitiveMemberOfRequestBuilder and applying a TransitiveMemberOfRequestBuilderGetRequestConfiguration->queryParameters->select I can see the URL is changed to include the $select fields in odataNextLink. But when I actualy run the query with get($groupsRequestConfig) the additional fields are not returned.
If I take the URL and put it into graph explorer, it returns the fields as requested.
Sample code and var_dump's
<?php
$groupsRequest = $GraphServiceClient->me()->transitiveMemberOf();
$groupsRequestConfig = new TransitiveMemberOfRequestBuilderGetRequestConfiguration();
$groupsRequestConfig->queryParameters = new TransitiveMemberOfRequestBuilderGetQueryParameters();
$groupsRequestConfig->queryParameters->select = [
'id',
'samAccountName',
'displayName',
'groupTypes',
'securityEnabled'
];
$groupsResponse = $groupsRequest->get($groupsRequestConfig); # Http\Promise\FulfilledPromise
$groups = $groupsResponse->wait(); # Microsoft\Graph\Generated\Models\DirectoryObjectCollectionResponse
$myGroups = []
foreach ($groups->getValue() as $g) {
$myGroups[] = $g->getDisplayName();
}
/*
$groups = object(Microsoft\Graph\Generated\Models\DirectoryObjectCollectionResponse)#302 (1) {
["backingStore":"Microsoft\Graph\Generated\Models\BaseCollectionPaginationCountResponse":private]=>
object(Microsoft\Kiota\Abstractions\Store\InMemoryBackingStore)#298 (4) {
["isInitializationCompleted":"Microsoft\Kiota\Abstractions\Store\InMemoryBackingStore":private]=>
bool(true)
["returnOnlyChangedValues":"Microsoft\Kiota\Abstractions\Store\InMemoryBackingStore":private]=>
bool(false)
["store":"Microsoft\Kiota\Abstractions\Store\InMemoryBackingStore":private]=>
array(3) {
["additionalData"]=>
array(3) {
[0]=>
bool(false)
[1]=>
array(1) {
["@odata.context"]=>
string(117) "https://graph.microsoft.com/v1.0/$metadata#directoryObjects(id,samAccountName,displayName,groupTypes,securityEnabled)"
}
[2]=>
int(1)
}
["odataNextLink"]=>
array(2) {
[0]=>
bool(false)
[1]=>
string(303) "https://graph.microsoft.com/v1.0/me/transitiveMemberOf?$select=id%2csamAccountName%2cdisplayName%2cgroupTypes%2csecurityEnabled&$skiptoken=R..."
}
["value"]=>
array(3) {
[0]=>
bool(false)
[1]=>
array(100) {
[0]=>
object(Microsoft\Graph\Generated\Models\Group)#194 (1) {
["backingStore":"Microsoft\Graph\Generated\Models\Entity":private]=>
object(Microsoft\Kiota\Abstractions\Store\InMemoryBackingStore)#193 (4) {
["isInitializationCompleted":"Microsoft\Kiota\Abstractions\Store\InMemoryBackingStore":private]=>
bool(true)
["returnOnlyChangedValues":"Microsoft\Kiota\Abstractions\Store\InMemoryBackingStore":private]=>
bool(false)
["store":"Microsoft\Kiota\Abstractions\Store\InMemoryBackingStore":private]=>
array(6) {
["additionalData"]=>
array(3) {
[0]=>
bool(true)
[1]=>
array(0) {
}
[2]=>
int(0)
}
["odataType"]=>
array(2) {
[0]=>
bool(true)
[1]=>
string(22) "#microsoft.graph.group"
}
["id"]=>
array(2) {
[0]=>
bool(true)
[1]=>
string(36) "b...4"
}
["displayName"]=>
array(2) {
[0]=>
bool(true)
[1]=>
NULL
}
...
$g = object(Microsoft\Graph\Generated\Models\Group)#556 (1) {
["backingStore":"Microsoft\Graph\Generated\Models\Entity":private]=>
object(Microsoft\Kiota\Abstractions\Store\InMemoryBackingStore)#555 (4) {
["isInitializationCompleted":"Microsoft\Kiota\Abstractions\Store\InMemoryBackingStore":private]=>
bool(true)
["returnOnlyChangedValues":"Microsoft\Kiota\Abstractions\Store\InMemoryBackingStore":private]=>
bool(false)
["store":"Microsoft\Kiota\Abstractions\Store\InMemoryBackingStore":private]=>
array(6) {
["additionalData"]=>
array(3) {
[0]=>
bool(true)
[1]=>
array(0) {
}
[2]=>
int(0)
}
["odataType"]=>
array(2) {
[0]=>
bool(true)
[1]=>
string(22) "#microsoft.graph.group"
}
["id"]=>
array(2) {
[0]=>
bool(true)
[1]=>
string(36) "8...8"
}
["displayName"]=>
array(2) {
[0]=>
bool(true)
[1]=>
NULL
}
....
*/
?>
PS. Please create more documentation, this sdk is a monster for having so little documentation and examples.
- 主要言語
- PHP
- スター
- 669
- フォーク
- 150
- 平均マージ
- 15時間 21分
- マージ済み PR(30日)
- 3
コントリビューションガイド
はじめの一歩
- 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 · リアクション 1 件 ·
-
Now オープン
難易度 5/5 1週間以上 初心者へのやさしさ 1/100
microsoftgraph/msgraph-sdk-php#1799 ·
microsoftgraph/msgraph-sdk-php の issue をすべて見る
似ている issue
-
sync-en
難易度 1/5 1〜3時間 初心者へのやさしさ 85/100
-
[6.x]: "Cannot use object of type stdClass as array" loading Users index (regression of #19182) オープン
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
getgrav/grav-plugin-api#45 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
RSS-Bridge/rss-bridge#5098 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
phingofficial/phing#2025 ·