This content is part of a third party extension that is not supported by the Cake project.
For more information about this extension see Cake.NSwag.
Summary
Gets a runner to invoke NSwag operations
- Assembly
- Cake
.NSwag .dll - Namespace
- Cake
.NSwag - Containing Type
- NSwagAliases
Syntax
public static NSwagRunner NSwag(this ICakeContext ctx)
Examples
Generate a Swagger spec from a generic .NET assembly
NSwag.FromAssembly("./assembly.dll").ToSwaggerSpecification("./typespec.json");
Generate a Swagger spec from an ASP.NET Web API assembly
NSwag.FromWebApiAssembly("./web.assembly.dll").ToSwaggerSpecification("./swagger.json");
Generate a Typescript client from a JSON Schema file
NSwag.FromJsonSchema("./schema.json").ToTypeScriptClient("./client.ts");
Generate a C# client from a Swagger specification
NSwag.FromSwaggerSpecification("./swagger.json").ToCSharpClient("./client.cs", "Swagger.Client");
Attributes
| Type | Description |
|---|---|
| Cake |
|
| Cake |
Parameters
| Name | Type | Description |
|---|---|---|
| ctx | ICakeContext | The Cake context |
Return Value
| Type | Description |
|---|---|
| NSwagRunner |
