Generate REST API clients
The DotVVM Command Line tool can also be used to add and update REST API bindings clients.
Even though the DotVVM CLI requires .NET Core, it can be used also for .NET Framework projects with OWIN since it is not a runtime component. It is used only on the developer machines.
Supported commands
Task | Syntax | Options |
---|---|---|
Add API Client | dotnet dotvvm api create |
|
Update API Client | dotnet dotvvm api regen |
|
The metadata of REST API Bindings are stored in dotvvm.json
file. If any of the parameters needs to be updated, you can change them in this file.
Please note that the API client needs to be registered in DotvvmStartup.cs
. See REST API bindings chapter for more details.
Examples
- Registering the API client:
dotnet dotvvm api create http://localhost:43852/swagger/v1/swagger.json DotVVM2.Demo.RestApi.Api Api/ApiClient.cs wwwroot/Scripts/ApiClient.ts
- Updating the generated clients:
dotnet dotvvm api regen