Skip to content

Incorrect parameter ordering for CancellationToken in generated RequestBuilder code #4692

Closed

Description

What are you generating using Kiota, clients or plugins?

API Client/SDK

In what context or format are you using Kiota?

Windows executable

Client library/SDK language

Csharp

Describe the bug

The generated API client code fails to compile with the following error:

Argument 3: cannot convert from 'System.Threading.CancellationToken' 
to 'System.Collections.Generic.Dictionary<string, 
Microsoft.Kiota.Abstractions.Serialization.ParsableFactory
<Microsoft.Kiota.Abstractions.Serialization.IParsable>>?'

Expected behavior

The generated code should compile without errors. Specifically, the 'cancellationToken' parameter should be preceded by 'null', as in:

var requestInfo = ToDeleteRequestInformation(requestConfiguration);
return await RequestAdapter.SendAsync<UntypedNode>(requestInfo, default, **null**, cancellationToken).ConfigureAwait(false);

How to reproduce

  1. Create a new .NET class library project.
  2. Generate the C# Api client.
  3. Compile the project.

Open API description file

No response

Kiota Version

1.14.0

Latest Kiota version known to work for scenario above?(Not required)

No response

Known Workarounds

Manually edit the generated code.

Configuration

Windows 11 x64

Debug output

Click to expand log ```
</details>


### Other information

_No response_
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

CsharpPull requests that update .net codetype:bugA broken experience

Type

No type

Projects

  • Status

    Done ✔️

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions