You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I generate a C# client with Kiota CLI version 1.8.2, result code doesn't correctly detect parameter type in url.
Type is correctly detected only if parameter is last url part (ex. http://myurl/<id>).
Generated RequestBuilder for my endpoint with parameter as last url part:
// <auto-generated/>usingMicrosoft.Kiota.Abstractions;usingMyNamespace.Users.Item;usingSystem.Collections.Generic;usingSystem.IO;usingSystem.Linq;usingSystem.Threading.Tasks;usingSystem;namespaceMyNamespace.Users{/// <summary>/// Builds and executes requests for operations under \users/// </summary>publicclassUsersRequestBuilder:BaseRequestBuilder{/// <summary>Gets an item from the MyNamespace.users.item collection</summary>/// <param name="position">Unique identifier of the item</param>publicWithUserItemRequestBuilderthis[Guidposition]{get{varurlTplParams=newDictionary<string,object>(PathParameters);urlTplParams.Add("userId",position);returnnewWithUserItemRequestBuilder(urlTplParams,RequestAdapter);}}/// <summary>Gets an item from the MyNamespace.users.item collection</summary>/// <param name="position">Unique identifier of the item</param>[Obsolete("This indexer is deprecated and will be removed in the next major version. Use the one with the typed parameter instead.")]publicWithUserItemRequestBuilderthis[stringposition]{get{varurlTplParams=newDictionary<string,object>(PathParameters);if(!string.IsNullOrWhiteSpace(position))urlTplParams.Add("userId",position);returnnewWithUserItemRequestBuilder(urlTplParams,RequestAdapter);}}/// <summary>/// Instantiates a new UsersRequestBuilder and sets the default values./// </summary>/// <param name="pathParameters">Path parameters for the request</param>/// <param name="requestAdapter">The request adapter to use to execute the requests.</param>publicUsersRequestBuilder(Dictionary<string,object>pathParameters,IRequestAdapterrequestAdapter):base(requestAdapter,"{+baseurl}/users",pathParameters){}/// <summary>/// Instantiates a new UsersRequestBuilder and sets the default values./// </summary>/// <param name="rawUrl">The raw URL to use for the request builder.</param>/// <param name="requestAdapter">The request adapter to use to execute the requests.</param>publicUsersRequestBuilder(stringrawUrl,IRequestAdapterrequestAdapter):base(requestAdapter,"{+baseurl}/users",rawUrl){}}}
Generated RequestBuilder for my endpoint with the parameter between two url part:
// <auto-generated/>usingMicrosoft.Kiota.Abstractions;usingMyNamespace.Groups.Item;usingSystem.Collections.Generic;usingSystem.IO;usingSystem.Linq;usingSystem.Threading.Tasks;usingSystem;namespaceMyNamespace.Groups{/// <summary>/// Builds and executes requests for operations under \groups/// </summary>publicclassGroupsRequestBuilder:BaseRequestBuilder{/// <summary>Gets an item from the MyNamespace.groups.item collection</summary>/// <param name="position">Unique identifier of the item</param>publicWithGroupItemRequestBuilderthis[stringposition]{get{varurlTplParams=newDictionary<string,object>(PathParameters);urlTplParams.Add("groupId",position);returnnewWithGroupItemRequestBuilder(urlTplParams,RequestAdapter);}}/// <summary>/// Instantiates a new GroupsRequestBuilder and sets the default values./// </summary>/// <param name="pathParameters">Path parameters for the request</param>/// <param name="requestAdapter">The request adapter to use to execute the requests.</param>publicGroupsRequestBuilder(Dictionary<string,object>pathParameters,IRequestAdapterrequestAdapter):base(requestAdapter,"{+baseurl}/groups",pathParameters){}/// <summary>/// Instantiates a new GroupsRequestBuilder and sets the default values./// </summary>/// <param name="rawUrl">The raw URL to use for the request builder.</param>/// <param name="requestAdapter">The request adapter to use to execute the requests.</param>publicGroupsRequestBuilder(stringrawUrl,IRequestAdapterrequestAdapter):base(requestAdapter,"{+baseurl}/groups",rawUrl){}}}
I search in issues but I didn't find any tickets for this bug.
The text was updated successfully, but these errors were encountered:
Just to confirm the bug you are seeing. You mean that the public WithGroupItemRequestBuilder this[string position] should have a corresponding public WithGroupItemRequestBuilder this[Guid position] , the same way the user has it?
Hello,
When I generate a C# client with Kiota CLI version 1.8.2, result code doesn't correctly detect parameter type in url.
Type is correctly detected only if parameter is last url part (ex.
http://myurl/<id>
).My swagger definition:
Used command line:
kiota generate -l CSharp -c MyClient -n MyNamespace -d swagger.json -o MyClient
Generated RequestBuilder for my endpoint with parameter as last url part:
Generated RequestBuilder for my endpoint with the parameter between two url part:
I search in issues but I didn't find any tickets for this bug.
The text was updated successfully, but these errors were encountered: