-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
CSharpControllerGenerator
Scott Kaye edited this page Nov 25, 2020
·
2 revisions
- Package: NSwag.CodeGeneration.CSharp
- Settings: CSharpControllerGeneratorSettings
- Issues: All open issues
Generates Web API/ASP.NET Core controllers from a Swagger/OpenAPI specification.
To generate ASP.NET Core controllers set:
ControllerTarget = CSharpControllerTarget.AspNetCore
ControllerBaseClass = "Microsoft.AspNetCore.Mvc.Controller"
dotnet "/.../dotnet-nswag.dll" openapi2cscontroller /input:https://somewhere.com/swagger.yaml /classname:MyResource /namespace:Com.Example.MyResource /output:Controllers/ResourceController.cs /UseLiquidTemplates:true /AspNetNamespace:"Microsoft.AspNetCore.Mvc" /ControllerBaseClass:"Microsoft.AspNetCore.Mvc.Controller"