Skip to content

Issues with CopyRequestBuilder.post() and to_post_request_information() on several RequestBuilder classes #334

@aberezh

Description

@aberezh

I’ve encountered two issues while working with the Drive functionality of msgraph-sdk-python.

  1. The first one was simple to investigate and seems to be easy to fix. The CopyRequestBuilder.post() method calls the self.request_adapter.send_async()
    return await self.request_adapter.send_async(request_info, DriveItem, error_mapping)
    method expecting a DriveItem as a response, while the Copy a DriveItem REST API doesn’t return anything. So I believe the fix should be simply to:
# replace this
return await self.request_adapter.send_async(request_info, DriveItem, error_mapping)
# with this
return await self.request_adapter.send_no_response_content_async(request_info, error_mapping)
  1. The second one is more tricky and I didn’t manage to get to the bottom of it in a reasonable amount of time. When the to_post_request_information() method is called on several RequestBuilder classes the request_info.set_content_from_parsable() does not actually set the content on RequestInfo (I ran into this with CopyRequestBuilder and ChildrenRequestBuilder)
    request_info.set_content_from_parsable(self.request_adapter, "application/json", body)
    request_info.set_content_from_parsable(self.request_adapter, "application/json", body)

    As far as I’ve understood after digging into it, the issue lies in the JsonSerializationWriter._serialize_value() method, more specifically with JsonSerializationWriter.on_before_object_serialization() method. But I may be wrong.

Would anyone be able to investigate/fix these issues any time soon?

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions