Setting additional_data for DriveItemUploadableProperties throw 400
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
- 42/100
Hướng nghiên cứu
Bắt đầu từ entry point create_upload_session và kiểm tra cách DriveItemUploadableProperties và CreateUploadSessionPostRequestBody tuần tự hóa dữ liệu bổ sung vào additional_data. Tái hiện request từ issue bằng msgraph.generated.models.drive_item_uploadable_properties và trường @microsoft.graph.conflictBehavior. Công việc được hoàn tất khi createUploadSession chấp nhận trường được tài liệu hóa và áp dụng hành vi xung đột được yêu cầu khi một tệp đã tồn tại.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Describe the bug
When try to add any field from the docs, such as "description" or "@microsoft.graph.conflictBehavior" to DriveItemUploadableProperties from msgraph.generated.models.drive_item_uploadable_properties msgraph throw this:
E msgraph.generated.models.o_data_errors.o_data_error.ODataError:
E APIError
E Code: 400
E message: None
E error: MainError(additional_data={}, code='invalidRequest', details=None, inner_error=InnerError(additional_data={}, client_request_id='463c4945-0f9c-435e-9ece-30e48ff358b6', date=DateTime(2024, 11, 6, 8, 37, 41, tzinfo=Timezone('UTC')), odata_type=None, request_id='48083d5b-ecd3-4176-8447-112ab2233e72'), message='The request is malformed or incorrect.', target=None)
code i used for this:
sp_url = f'{self.drive_path}/items/root:{remote_path}:'
sp_session_url = sp_url + '/createUploadSession'
base_request_builder = (
self.client.drives.by_drive_id(self.drive_id)
.items.by_drive_item_id("root").create_upload_session.with_url(
sp_session_url,
)
)
create_session_response = await base_request_builder.post(
CreateUploadSessionPostRequestBody(
item=DriveItemUploadableProperties(
name=file_name,
additional_data={
"@microsoft.graph.conflictBehavior": "rename",
},
),
)
)
I also tried to add additional_data to CreateUploadSessionPostRequestBody but it does nothing
Expected behavior
When uploading file to Sharepoint and file with the same name already exists it must add suffix (1) or _1 to the new file
How to reproduce
try to upload file with createUploadSession if file with that name already exists using code above
SDK Version
1.9.0
Latest version known to work for scenario above?
No response
Known Workarounds
No response
Debug output
Click to expand log
```</details>
### Configuration
_No response_
### Other information
_No response_
- 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
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-python
-
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 90/100
microsoftgraph/msgraph-sdk-python#1570 ·
-
status:waiting-for-triage type:bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
microsoftgraph/msgraph-sdk-python#1563 ·
-
Needs: Attention :wave: type:bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
microsoftgraph/msgraph-sdk-python#1287 · 2 bình luận · 1 reaction ·
-
Batch Request Support Đang mởstatus:waiting-for-triage
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
microsoftgraph/msgraph-sdk-python#1557 ·
-
status:waiting-for-triage type:bug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 55/100
microsoftgraph/msgraph-sdk-python#1556 · 1 bình luận · 1 reaction ·
Tất cả issue của microsoftgraph/msgraph-sdk-python
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
-
🐛 Bug 🔔 Pending processing
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
jumpserver/jumpserver#17584 ·