openapi-generator
openapi-generator copied to clipboard
[BUG] Looks like a copy paste bug "`1.cs" in file "CSharpNetCoreClientCodegen.java"
Bug Report Checklist
- [ ] Have you provided a full/minimal spec to reproduce the issue?
- [ ] Have you validated the input using an OpenAPI validator (example)?
- [ ] Have you tested with the latest master to confirm the issue still exists?
- [ ] Have you searched for related issues/PRs?
- [ ] What's the actual output vs expected output?
- [ ] [Optional] Sponsorship to speed up the bug fix or feature request (example)
Description
When I executed the Net Core generator with the Library flag set to "generichost", I noticed several of my file names had "`1.cs" on the end.
I did a search of the repo and it looks like it may be a copy past bug. "`1.cs")%3B)

openapi-generator version
docker pull openapitools/openapi-generator-cli:v6.1.0
Steps to reproduce
docker run --rm -v C:\Dev\OpenAPI_CodeGen:/local openapitools/openapi-generator-cli:v6.1.0 generate -i /local/My_swagger.json -g csharp-netcore -o /local/csharp/OpenApi --skip-validate-spec --additional-properties=netCoreProjectFile=true,targetFramework=net6.0,packageName=MyClient.SDK --library=generichost
Suggest a fix
Remove the "`1" from the affected strings and mustache file names.
thanks for reporting the issue
cc @devhl-labs
This is intentional. In C#, a class gets it's own file. That means a generic class must have some different file name than it's non-generic counterpart. We use `x where x is the number of generic parameters. This is what Microsoft used to do, but looks like they're now using underscores instead of the grave accent.
Thanks for the Info @devhl-labs