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.AutoRest.
Summary
Invokes AutoRest to create a client model for the provided API spec, optionally using the provided settings.
- Assembly
- Cake
.AutoRest .dll - Namespace
- Cake
.AutoRest - Containing Type
- AutoRestRunner
Syntax
public DirectoryPath Generate(FilePath inputFile, Action<AutoRestSettings> configure = null)
Examples
Run with all the defaults:
Task("Use-Defaults")
.Does(() => {
AutoRest.Generate("./sample.json");
});
Configure using fluent interface (equivalent to above)
Task("Fluent-Interface")
.Does(() => {
AutoRest.Generate("./sample.json", settings =>
settings.UseNamespace("Cake")
.UseClientName("Cake.AutoRest")
.AddHeaderComment("Generated by Cake.AutoRest")
.WithGenerator(CodeGenerator.AzureCSharp)
.OutputToDirectory("./dist/client"));
});
Parameters
Name | Type | Description |
---|---|---|
inputFile | FilePath | Local API specification file (e.g. swagger definition) |
configure | Action |
Optional action to configure runner settings |
Return Value
Type | Description |
---|---|
DirectoryPath | The directory where the client was generated |