Skip to content

TeamsTemplatesRequestBuilder not heeding QueryParameters #1113

@ssteiner

Description

@ssteiner

Describe the bug

Because teams templates are not part of the v1.0 SDK (seems a long time to be in beta but anyways..), I'm targetting the beta endpoint to fetch teams templates using Microsoft.Graph.TeamsTemplates.TeamsTemplatesRequestBuilder. When I build the url with all query parameters manually, things work as expected. If I instead use the standard approach to configure request parameters, these are not heeded.

var builder = new Microsoft.Graph.TeamsTemplates.TeamsTemplatesRequestBuilder("https://graph.microsoft.com/beta/teamwork/teamTemplates", graphServiceClient.RequestAdapter);
var templates = await builder.GetAsync(requestConfiguration => 
{
    requestConfiguration.QueryParameters.Expand = ["definitions"];
    requestConfiguration.QueryParameters.Filter = filter;
}).ConfigureAwait(false);

In this case I'd expect the URL being queried to be GET /beta/teamwork/teamTemplates?$expand=definitions, but instead, it goes to /beta/teamwork/teamTemplates.

Expected behavior

I would expect the query parameters to be heeded, so in the above sample the request would go to /beta/teamwork/teamTemplates?$expand=definitions

How to reproduce

Run this code

var builder = new Microsoft.Graph.TeamsTemplates.TeamsTemplatesRequestBuilder("https://graph.microsoft.com/beta/teamwork/teamTemplates", graphServiceClient.RequestAdapter);
var templates = await builder.GetAsync(requestConfiguration => 
{
    requestConfiguration.QueryParameters.Expand = ["definitions"];
    requestConfiguration.QueryParameters.Filter = filter;
}).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

_No response_

### Other information

_No response_

Metadata

Metadata

Assignees

Labels

type:bugA broken experience

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions