microsoftgraph / microsoftgraph/msgraph-beta-sdk-java
Cannot update sponsors of user
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 32
- Forks
- 14
- Avg merge
- 1d 3h
- Merged PRs (30d)
- 6
Description
Describe the bug
Im updating a user with new sponsors but in the update user throw an internal issue.
Expected behavior
Update the user with the sponsors provided
How to reproduce
Get a User class for existing user with sponsors, modify the sponsors list adding a new sponsors, set and update user.
SDK Version
6.13.0
Latest version known to work for scenario above?
No response
Known Workarounds
No response
Debug output
Click to expand log
```Exception in thread "main" com.microsoft.graph.beta.models.odataerrors.ODataError: The context URL 'https://graph.microsoft.com/beta/$metadata#users(sponsors())/$entity' is invalid.
at com.microsoft.graph.beta.models.odataerrors.ODataError.createFromDiscriminatorValue(ODataError.java:36)
at com.microsoft.kiota.serialization.JsonParseNode.getObjectValue(JsonParseNode.java:212)
at com.microsoft.kiota.http.OkHttpRequestAdapter.lambda$throwIfFailedResponse$0(OkHttpRequestAdapter.java:674)
at com.microsoft.kiota.ApiExceptionBuilder.(ApiExceptionBuilder.java:26)
at com.microsoft.kiota.http.OkHttpRequestAdapter.throwIfFailedResponse(OkHttpRequestAdapter.java:673)
at com.microsoft.kiota.http.OkHttpRequestAdapter.send(OkHttpRequestAdapter.java:281)
at com.microsoft.graph.beta.users.item.UserItemRequestBuilder.patch(UserItemRequestBuilder.java:1138)
at com.microsoft.graph.beta.users.item.UserItemRequestBuilder.patch(UserItemRequestBuilder.java:1122)
at xxx.MSEntraService.updateUser(MSEntraService.java:86)
at xxx.Main.main(Main.java:147)
</details>
### Configuration
Windows 11 x64
### Other information
Any interaction with sponsors throw an error
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the sponsor update with the Java SDK 6.13.0, then inspect UserItemRequestBuilder.java and the call sites in MSEntraService.java and Main.java named in the stack trace. Compare the request and returned context URL for sponsor updates; done means an existing user's sponsors can be modified and the update completes without the ODataError.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100