Open srad opened 3 months ago
When you define a single class name, but there are multiple endpoints in the openapi description with overlapping names, those are generated inside the same class, which yields duplicate code, see https://github.com/RicoSuter/NSwag/issues/2660
I just updated from
13.19.0
to14.0.7
and it seems that theswagger2csclient
has been removed. I switched toopenapi2csclient
now, but the generated code is vaulty. It generates the client class twice into the same file and hence causes an compilation error.The command I ran:
.\nswag\Net80\dotnet-nswag.exe openapi2csclient /input:http://somewhere:1234/swagger/v1/swagger.json /classname:MyApiClient /namespace:SomeWhere.Clients /output:.\Somewhere\Clients\MyApiClient.cs
here is the generated code. I collapsed everything except of the classes and the entire code is inserted twice: