[2.0.0-RC13] TransitiveMemberOfRequestBuilder ignoring QueryParameters select
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 38/100
Hướng nghiên cứu
Bắt đầu từ TransitiveMemberOfRequestBuilder->get() và cách xử lý queryParameters->select, sau đó theo dõi cách response điền dữ liệu vào DirectoryObjectCollectionResponse và các model Group. So sánh các field được yêu cầu trong URL được tạo với các field có sẵn sau wait(); hoàn thành khi các property được chọn được trả về một cách nhất quán.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- PHP
- Star
- 669
- Fork
- 150
- Merge trung bình
- 15 giờ 21 phút
- Pull request đã merge (30 ngày)
- 3
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của microsoftgraph/msgraph-sdk-php
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
microsoftgraph/msgraph-sdk-php#1794 · 2 bình luận ·
-
bug: metadata type:bug
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
microsoftgraph/msgraph-sdk-php#1739 · 6 bình luận ·
-
status:waiting-for-triage type:bug
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 68/100
microsoftgraph/msgraph-sdk-php#1643 · 8 bình luận · 4 reaction ·
-
status:waiting-for-triage
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
microsoftgraph/msgraph-sdk-php#1800 · 1 reaction ·
-
Now Đang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 1/100
microsoftgraph/msgraph-sdk-php#1799 ·
Tất cả issue của microsoftgraph/msgraph-sdk-php
Issue tương tự
-
sync-en
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 85/100
-
[6.x]: "Cannot use object of type stdClass as array" loading Users index (regression of #19182) Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
getgrav/grav-plugin-api#45 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
RSS-Bridge/rss-bridge#5098 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
phingofficial/phing#2025 ·