microsoftgraph / microsoftgraph/msgraph-sdk-dotnet

"Invalid property 'businessPhones' specified in $select." on querying for a user's membership of a group in v5

Open
#1,853 9 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Bug: metadata OpenApi type:bug
Dominant language
C#
Stars
789
Forks
264
Avg merge
15h 17m
Merged PRs (30d)
3

Description

Describe the bug
In v4 the following request was allowed (i.e. it was not a bad request):-

// v4 - this works
await _graphClient.Groups[targetGroup.Id].Members[user.Id].Request().GetAsync();

If this request succeeded, you could count on the indicated user being a member of the indicated group.

Removing Request() from the above results in code that doesn't compile, so I used:-

// v5 - this doesn't work
await _graphClient.Groups[targetGroup.Id].Members[user.Id].GraphUser.GetAsync();

but this code throws an ODataError exception (so it really should be called ODataErrorException but that's another story) with a bad request error message:-

"Invalid property 'businessPhones' specified in $select."

What is strange is that the v5 request to determine if a group (as opposed to a user) is a member of a group is fine, and doesn't result in a bad request:-

// v5 - this works
await _graphClient.Groups[targetGroup.Id].Members[group.Id].GraphGroup.GetAsync();

To Reproduce
In version 5.7.0 of Microsoft.Graph package, execute:-

await _graphClient.Groups[targetGroup.Id].Members[user.Id].GraphUser.GetAsync();

Expected behavior
No exception thrown, and certainly not an OData exception indicating a bad request with error message "Invalid property 'businessPhones' specified in $select.".

Screenshots

Desktop (please complete the following information):

  • OS: Windows 10
  • Browser: Edge

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.

Research direction

Start by running the version 5.7.0 reproduction with Groups[targetGroup.Id].Members[user.Id].GraphUser.GetAsync(), then compare it with the working GraphGroup.GetAsync() call. Trace the request generated by GraphUser.GetAsync and verify that the membership query no longer selects the invalid businessPhones property; the user membership lookup should complete without an ODataError.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.