RicoSuter / NSwag

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

Cannot pass options to NSwag code generation when added through Visual Studio Connected Services #4780

Open lukasf opened 5 months ago

lukasf commented 5 months ago

When I add an OpenAPI service reference in a .NET Core project in Visual Studio via "Connected Services", NSwag is used to generate the C# client. In the Connected Services dialog, there is a field "Additional code generation options". According to this page, it should be possible to set command line options here, to customize the NSwag code generation.

I need to use DateOnly as DateType, and I tried lots of things: /DateType:System.DateOnly /DateType:"System.DateOnly" /DateType:"DateOnly" /dateType:System.DateOnly /dateType System.DateOnly /dateType=System.DateOnly

But none of these worked. I also did not find any information in the Wiki. I also tried other options, but none of them seemed to have any effect.

Can anyone tell me how to customize the code generation using VS Connected Services? This should be documented in the Wiki in a prominent way.