swagger-api / swagger-api/swagger-codegen
[C#] Wierd names when generating clients
Nobody has claimed this yet.
- Dominant language
- Mustache
- Stars
- 17.8k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
Description
I'm using Swagger to generate my definition, and then i consume this using c# code-gen.
The issue i have is that the parameter names of controller functions end up wierd: SelectGenericModelQuery_1OfOfArticleViewModelAndApplicationAnd_0AndCulture_neutralAndPublicKeyToken_null
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")]
public partial class **SelectGenericModelQuery_1OfOfArticleViewModelAndApplicationAnd_0AndCulture_neutralAndPublicKeyToken_null**
{
[Newtonsoft.Json.JsonProperty("filter", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public System.Collections.Generic.IDictionary<string, object> Filter { get; set; }
[Newtonsoft.Json.JsonProperty("pageNumber", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public int PageNumber { get; set; }
[Newtonsoft.Json.JsonProperty("pageSize", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public int PageSize { get; set; }
}
My controller endpoint looks like this:

Swagger definition:

Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the C# client generation from the Swagger definition shown in the issue and inspect how the controller parameter type becomes the generated class name. Compare the generated name with the intended name and identify the relevant code-generation entry point; done means the generated client uses stable, readable parameter names without regressing other C# models.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, openapi
- Domain
- api, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100