RicoSuter / NSwag

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

Generating C# Web API Controllers, no response codes #1918

Open timmvonputtkamer opened 5 years ago

timmvonputtkamer commented 5 years ago

From an Open API spec I generate C# code for some web API controllers (ASP.NET Core). However, in the generated code it seems to me that no HTTP status codes are specified (e.g. by using attributes like [ProducesResponseType(404)] before each method definition). This has the effect that the Swagger UI generated from the code lacks any information about the different return codes, only 200 appears. Did I miss anything in the configuration of the code generator?

RicoSuter commented 5 years ago

The controller generator is not really ready for ASP.NET Core output and needs a lot of work... see https://github.com/RSuter/NSwag/projects/4