NSwagAliases.

NSwag(ICakeContext) Method

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
CakePropertyAliasAttribute
CakeNamespaceImportAttribute

Parameters

Name Type Description
ctx ICakeContext The Cake context

Return Value

Type Description
NSwagRunner