Skip to content

Conversation

@carterm-hdc
Copy link
Contributor

Overview

The batch request item serialization does not currently work for the header and body fields. For both of them, a dictionary is being passed to the write_collection_of_object_values, which is supposed to be given a list of parsable objects. An ignore type annotation is being given to silence the error.

I've replaced the method with write_additional_data_value. This method accepts a dictionary of arbitrary types, so it's able to handle the deserialized json string for the body.

Demo

Notes

The write_additional_data_value is not intended to be used in this way, and is usually used to handle excess fields that may be included in the body of a request, but are not part of the parsable model class. A dedicated method for serializing dicts is probably needed.

Testing Instructions

@carterm-hdc carterm-hdc requested a review from a team as a code owner June 18, 2025 20:12
Copy link
Member

@baywet baywet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution!

Can you add unit tests please?

Adding this test required fixing the request_info fixture and the test_initialization test because
they were using a BytesIO object when the content field should just be bytes.
@carterm-hdc
Copy link
Contributor Author

@microsoft-github-policy-service agree

…tionWriter to test the result of serialization
@github-actions
Copy link
Contributor

This pull request has conflicting changes, the author must resolve the conflicts before this pull request can be merged.

baywet
baywet previously approved these changes Jun 27, 2025
Copy link
Member

@baywet baywet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for making the changes!

baywet
baywet previously approved these changes Jun 27, 2025
@baywet baywet enabled auto-merge (squash) June 27, 2025 15:42
@sonarqubecloud
Copy link

@baywet baywet merged commit 7b5ad11 into microsoftgraph:main Jun 27, 2025
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants