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, using the provided settings
- Assembly
- Cake
.AutoRest .dll - Namespace
- Cake
.AutoRest - Containing Type
- AutoRestRunner
Syntax
public DirectoryPath Generate(FilePath inputFile, AutoRestSettings settings)
Examples
Configure using AutoRestSettings object
Task("Settings-Object")
.Does(() => {
var settings = new AutoRestSettings {
Namespace = "Cake",
Generator = CodeGenerator.AzureCSharp,
ClientName = "Cake.AutoRest",
HeaderComment = "Generated by Cake.AutoRest",
OutputDirectory = "./dist/client"
};
AutoRest.Generate("./sample.json", settings);
});
Parameters
Name | Type | Description |
---|---|---|
inputFile | FilePath | Local API specification file (e.g. swagger definition) |
settings | AutoRestSettings | Settings to use when invoking AutoRest |
Return Value
Type | Description |
---|---|
DirectoryPath | The directory where the client was generated |