Workleap.OpenApi.MSBuild
0.2.1-preview.9
Prefix Reserved
See the version list below for details.
dotnet add package Workleap.OpenApi.MSBuild --version 0.2.1-preview.9
NuGet\Install-Package Workleap.OpenApi.MSBuild -Version 0.2.1-preview.9
<PackageReference Include="Workleap.OpenApi.MSBuild" Version="0.2.1-preview.9"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
<PackageVersion Include="Workleap.OpenApi.MSBuild" Version="0.2.1-preview.9" />
<PackageReference Include="Workleap.OpenApi.MSBuild"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
paket add Workleap.OpenApi.MSBuild --version 0.2.1-preview.9
#r "nuget: Workleap.OpenApi.MSBuild, 0.2.1-preview.9"
#:package Workleap.OpenApi.MSBuild@0.2.1-preview.9
#addin nuget:?package=Workleap.OpenApi.MSBuild&version=0.2.1-preview.9&prerelease
#tool nuget:?package=Workleap.OpenApi.MSBuild&version=0.2.1-preview.9&prerelease
Workleap.OpenApi.MSBuild
Validates 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 Contract-First or Code-First development mode this MSBuild task will:
- Install tools: OasDiff, Spectral, SwashbuckleCLI
- Generate the OpenAPI specification file from the associated Web API
- Validate Workleap Spectral rules
- Compare the given OpenAPI specification file with the generated one
How it works
For the TLDR version:
- The entry point is
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.targetsas aUsingTask.TaskName - The default value are defined in the property group on the target
ValidateOpenApiin this file./src/Workleap.OpenApi.MSBuild/msbuild/tools/Workleap.OpenApi.MSBuild.targets
How to test locally
How debug the project
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.
With the system test
This command ./Run-SystemTest.ps1 will:
- Pack the MSBuild library
- Build the WebApi.MsBuild.SystemTest and inject the previously packed library
Be careful since it will update the project dependencies to use a local version: do not commit this.
Also if you run it multiple time on the same branch you need to clear the local cache %UserProfile%\.nuget\packages\workleap.openapi.msbuild since the name won't change.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- CliWrap (>= 3.6.6)
- Microsoft.Build.Utilities.Core (>= 17.9.5)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.