-
Notifications
You must be signed in to change notification settings - Fork 9
/
usage.cake
25 lines (21 loc) · 734 Bytes
/
usage.cake
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#r "dist/lib/Cake.NSwag.dll"
Task("Sample")
.Does(() => {
CreateDirectory("./dist/sample");
#break
NSwag.FromSwaggerSpecification("./samples/swagger.json")
.ToCSharpClient("./client.cs", "Swagger.Client")
.ToTypeScriptClient("./client.ts", s => s.WithClassName("Client").WithModuleName("Swagger"));
});
Task("Full-Settings")
.Does(() => {
NSwag.FromSwaggerSpecification("./samples/swagger.json")
.ToTypeScriptClient("./client.ts", s =>
s.WithClassName("ApiClient")
.WithModuleName("SwaggerApi")
.WithSettings(new SwaggerToTypeScriptClientGeneratorSettings
{
PromiseType = PromiseType.Promise
}));
});
RunTarget("Sample");