The `top` and `filter` query parameters do not work together

Đang mở
#1,485 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

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
45/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
php
Lĩnh vực
api

Hướng nghiên cứu

Bắt đầu bằng cách tái hiện script với UsersRequestBuilderGetRequestConfiguration, so sánh request được tạo ra khi filter và top được sử dụng cùng nhau với request chỉ sử dụng top. Theo dõi cách các tham số truy vấn của request Users được tuần tự hóa và xác minh xem service hoặc SDK có loại bỏ top hay không. Hoàn tất khi request kết hợp tôn trọng top=10, hoặc vấn đề được ghi lại là một giới hạn của upstream service.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

When the filter and top query parameters are both set, the top parameter appears to be ignored. The following script echoes 1000 . This appears to be the maximum allowed page size.
When the filter parameter is removed, the script echoes 10 - as expected.

use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Users\UsersRequestBuilderGetRequestConfiguration;

$tokenRequestContext = new ClientCredentialContext(
   'tenant_id',
   'client_id',
   'client_secret' 
);

$graphServiceClient = new GraphServiceClient($tokenRequestContext);

$queryParameters = UsersRequestBuilderGetRequestConfiguration::createQueryParameters();
$queryParameters->filter = "signInActivity/lastSignInDateTime ge 2024-01-01T00:00:00Z";
$queryParameters->top = 10;

$requestConfiguration = new UsersRequestBuilderGetRequestConfiguration();
$requestConfiguration->queryParameters = $queryParameters;

$result = $graphServiceClient->users()->get($requestConfiguration)->wait();
echo count($result->getValue());
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

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của microsoftgraph/msgraph-sdk-php

Tất cả issue của microsoftgraph/msgraph-sdk-php

Issue tương tự

Thêm issue về PHP

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.