[BUG]: Creating a new tree with a null sha tree object fails #2836
Labels
Type: Bug
Something isn't working as documented
Type: Support
Any questions, information, or general needs around the SDK or GitHub APIs
What happened?
I'd like to delete multiple files within one commit, so was constructing a tree with multiple objects with a null sha, as per documentation. I get an API error
Must supply either tree.sha or tree.content. Request will be rejected if both are present.
. When I run an identical API request via Postmark with sha set to null, it succeeds in creating the tree. When I run the request with sha not present, I see that API error.I imagine its something in the serializer stripping out null fields, when in this case I would like them to be preserved.
I can't use the client.Repository.Content.DeleteFile api, as that creates a new commit for every file you delete.
Example failing code below.
Versions
Octokit 9.0.0 running on net6.0
Relevant log output
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: