RicoSuter / NSwag

The Swagger/OpenAPI toolchain for .NET, ASP.NET Core and TypeScript.
http://NSwag.org
MIT License
6.72k stars 1.29k forks source link

Is there a way to make nswag behave the same as the swagger export from swaggerhub? #4848

Open KutanaDev opened 5 months ago

KutanaDev commented 5 months ago

This stackoverflow answer demonstrates the behaviour of swaggerhub - each operationId in the input yaml file gives rise to two methods in the generated cs file, one has the WithHttpInfo suffix, the other does not.

I want to use the nswag tool instead of swaggerhub to generate cs files from my yaml input file. I can successfully run nswag in my Visual Studio project, because I have an OpenApiReference element in my csproj file.

However, the generated cs files do not contain any functions with the WithHttpInfo suffix.

This page lists the nswag command line switches, and I've tried all the likely looking ones, but to no avail.

My question is - are there any nswag command line switches that will cause it to produce pairs of functions like swaggerhub does?

(I already posted this question on stackoverflow where, for reasons unknown to me, it got an immediate dv.)