microsoftgraph / microsoftgraph/msgraph-sdk-dotnet

QueryParameters should not offer Expand for Teams

Open
#3,097 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Describe the bug

I'm implementing a search on Teams. I found through trial&error (the documentation should really be updated with details about each prop.. what requires $select, what filters are supported, that kind of things), and found that if I populate the Expand parameter in the query options, the operation fails and returns

Query option 'Expand' is not allowed. To allow it, set the 'AllowedQueryOptions' property on EnableQueryAttribute or QueryValidationSettings

Since those options are server side, it basically boils down to: don't use Expand here. So I think a tag is missing that blocks out this option from the generated code.

Expected behavior

Microsoft.Graph.Teams.TeamsRequestBuilder.TeamsRequestBuilderGetQueryOptions should not offer the Expand property.

How to reproduce

Run this operation

var items = await graphServiceClient.Teams.GetAsync(o => 
{
    o.QueryParameters.Expand = ["members"];
}).ConfigureAwait(false);
SDK Version

5.104.0

Latest version known to work for scenario above?

No response

Known Workarounds

No response

Debug output
Click to expand log ```
</details>


### Configuration

Win 11 2024H2 on x64
.NET SDK 10.0.202

### Other information

_No response_

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 with Microsoft.Graph.Teams.TeamsRequestBuilder.TeamsRequestBuilderGetQueryOptions and trace how its query options are generated for the Teams Get operation. Reproduce the operation with Expand set to members, then verify that the generated options no longer expose Expand and that the request succeeds without the server-side validation error.

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
Quiet
Clarity
Clearly specified
Newbie friendliness
67/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.