Skip to content

Update OData method support for setting parameters on composable functions #175

@MIchaelMainer

Description

@MIchaelMainer

Parameters for functions aren't set on the URL until .Request() is called on the BaseFunctionMethodRequestBuilder. This was fine before composable function support. With composable functions, we need to update the URL sooner or else we won't be able to pass in parameters to functions that are not the final function. This means building function parameters in the generated request builders and not in BaseFunctionMethodRequestBuilder.

So, we will:

  • remove the line66 where parameters are added in BaseFunctionMethodRequestBuilder. This means that we need to generate MethodRequestBuilder.cs.tt based request builders that will set the parameters on the URL.
  • add a protected GetParametersString() that the generated request builders will use after set the parameters so that we get the fully formed parameter string for the function request builder. The generated request builder will append the parameter string to the *requestUrl`.

After inspecting this code file, it appears that we should:

  • remove passParametersInQueryString as it is neither used in this repo nor in msgraph-sdk-dotnet. It defaults to false. Be careful of dependencies based on this value.
  • Check any query options and validate that they are only $filter or $orderby per spec.
  • Support the passing of both HeaderOption and QueryOption.

These changes will need to published first so we can validate the generated changes and publish them on the same day. We shouldn't list these changes on NuGet until after the generated library (v1.0 and beta) is published. This will be a breaking change for older versions of the generated libraries, so we will need to make sure we set the minimum dep version for the generated library to this version of core.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions