microsoftgraph / microsoftgraph/msgraph-sdk-python

Inconsistent usage of 'select' OData system query option

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

Chưa có ai nhận issue này.

bug dependency:metadata
Ngôn ngữ chính
Python
Star
630
Fork
96
Merge trung bình
15 giờ 20 phút
Pull request đã merge (30 ngày)
3

Mô tả

Describe the bug

When I query the SharePoint API using 'expand' and 'select' query options, the API expects 'select' and not '$select'.

This is not a huge problem as I can easily change my query params to use 'select', however we cannot use the Python msgraph SDK as it always converts the special system query options with a $ prepended.

To Reproduce
Steps to reproduce the behavior:

  1. Using the Developer Graph Explorer run a query similar to this:

/items$expand=fields&$select=fields/status,lastModifiedDateTime,id

  1. See error:
    { "error": { "code": "BadRequest", "message": "Parsing OData Select and Expand failed: Found a path with multiple navigation properties or a bad complex property path in a select clause. Please reword your query such that each level of select or expand only contains either TypeSegments or Properties.", "innerError": { "date": "2024-04-09T18:29:12", "request-id": "60cb4f4b-e5f4-48ee-8f1c-981e88440310", "client-request-id": "ed396593-a29f-0d6b-d2d7-d8dc632e4edc" } } }

Workaround
4.Change the '$select' query param to 'select' (without the dollar sign) and you get a valid response.

/items$expand=fields&select=fields/status,lastModifiedDateTime,id

Expected behavior
A valid listitems response from the API using $select

Additional context
This also happens on the items/{id}/versions endpoint

Documentation for OData query options indicates $select as the query param:

https://learn.microsoft.com/en-us/odata/concepts/queryoptions-overview

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.

Hướng nghiên cứu

Tái hiện yêu cầu trong Developer Graph Explorer và thông qua Python msgraph SDK, tập trung vào các endpoint items và items/{id}/versions. Theo dõi cách SDK tuần tự hóa các tùy chọn truy vấn hệ thống OData và so sánh các yêu cầu sử dụng '$select' với hành vi được ghi nhận trong tài liệu. Hoàn thành khi các phản hồi list-items và versions hợp lệ hoạt động cùng với '$select' và '$expand'.

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

Đánh giá

Công nghệ
python
Lĩnh vực
api
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
35/100

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.