Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

How to add @microsoft.graph.conflictBehavior to a PUT request?

Open
#557 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
25/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
python
Domain
api

Research direction

Start at the fluent request entry point shown in the issue, especially the drive item content PUT call, and trace how request options are represented and sent. Done means the request can express the requested fail-on-conflict behavior and the resulting Graph API request uses the expected conflict setting.

Written by the indexing model from the issue text.

Description

I have this piece of code:

await client.drives \
   .by_drive_id(drive_id) \
   .items \
   .by_drive_item_id(f'root:/foo/baz/bar.txt:') \
   .content \
   .put(body)

I want it to fail if the file already exists.

According to this StackOverflow answer, I have to add @microsoft.graph.conflictBehavior with a value of fail somewhere. My question is: where? There's no additional_data key where I can pass this to, like it is shown in some other examples.

Dominant language
Python
Stars
630
Forks
96
Avg merge
15h 20m
Merged PRs (30d)
3

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from microsoftgraph/msgraph-sdk-python

All issues in microsoftgraph/msgraph-sdk-python

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.