Validates at build time that the OpenAPI specification files extracted from the ASP.NET Core Web API being built conform to Workleap API guidelines.
$ dotnet add package Workleap.OpenApi.MSBuildValidates at build time that the OpenAPI specification files extracted from the ASP.NET Core Web API being built conform to Workleap API guidelines.
Depending if the user chose the ValidateContract or GenerateContract development mode this MSBuild task will:
For the TLDR version:
ValidateOpenApiTask.ExecuteAsync() and will be executed after the referencing project is built. This is defined in ./src/Workleap.OpenApi.MSBuild/msbuild/tools/Workleap.OpenApi.MSBuild.targets as a UsingTask.TaskNameValidateOpenApi in this file ./src/Workleap.OpenApi.MSBuild/msbuild/tools/Workleap.OpenApi.MSBuild.targetsOpenApiServiceProfile MSBuild property (backend (default) or frontend).The MSBuild task uses Swashbuckle.AspNetCore.Cli to generate OpenAPI specifications. The version is resolved in the following order (highest to lowest priority):
OpenApiSwaggerVersion MSBuild property: <PropertyGroup>
<OpenApiSwaggerVersion>10.3.0</OpenApiSwaggerVersion>
</PropertyGroup>
Since it's a MSBuild task named ValidateOpenApi you can run it this command: msbuild /t:ValidateOpenApi. ./src/WebApiDebugger already have some preconfigured in launchSettings.json that you can run in debug.
Note: Before executing this task it will build the project.
Warming: validate your IDE is in Configuration:Debug otherwise the execution will not be done on the most recent code.