-
Notifications
You must be signed in to change notification settings - Fork 305
CSharp - Path Parameters should keep their name and descriptions #2978
Copy link
Copy link
Closed
Labels
WIPenhancementNew feature or requestNew feature or requestgeneratorIssues or improvements relater to generation capabilities.Issues or improvements relater to generation capabilities.
Milestone
Description
Using the OpenAPI 3.0.0 petstore sample
kiota generate -d "https://raw.githubusercontent.com/OAI/OpenAPI-Specification/main/examples/v3.0/petstore.json" -l CSharpThe part of interest is
"paths": {
"/pets/{petId}": {
"get": {
"parameters": [
{
"name": "petId",
"in": "path",
"required": true,
"description": "The id of the pet to retrieve",
"schema": {
"type": "string"
}
}
]
}
}
}Current Behavior
The following block of code is created for the indexer
/// <summary>Gets an item from the ApiSdk.pets.item collection</summary>
public WithPetItemRequestBuilder this[string position] { get {
var urlTplParams = new Dictionary<string, object>(PathParameters);
if (!string.IsNullOrWhiteSpace(position)) urlTplParams.Add("petId", position);
return new WithPetItemRequestBuilder(urlTplParams, RequestAdapter);
} }Expected Behavior
I would like for the position variable to be named the same as the path parameter petId. I would also like for path parameter's description to be kept and placed in a corresponding <param/> documentation.
/// <summary>Gets an item from the ApiSdk.pets.item collection</summary>
/// <param name="petId">The id of the pet to retrieve</param>
public WithPetItemRequestBuilder this[string petId] { get {
var urlTplParams = new Dictionary<string, object>(PathParameters);
if (!string.IsNullOrWhiteSpace(petId)) urlTplParams.Add("petId", petId);
return new WithPetItemRequestBuilder(urlTplParams, RequestAdapter);
} }Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
WIPenhancementNew feature or requestNew feature or requestgeneratorIssues or improvements relater to generation capabilities.Issues or improvements relater to generation capabilities.
Type
Projects
Status
Done ✔️

