Skip to content

Validates at build time that the OpenAPI specification files extracted from the ASP.NET Core Web API being built conform to Workleap API guidelines.

License

Notifications You must be signed in to change notification settings

gsoft-inc/wl-openapi-msbuild

Repository files navigation

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 ValidateContract or GenerateContract development mode this MSBuild task will:

How it works

Official Documentation

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.targets as a UsingTask.TaskName
  • The default value are defined in the property group on the target ValidateOpenApi in this file ./src/Workleap.OpenApi.MSBuild/msbuild/tools/Workleap.OpenApi.MSBuild.targets
  • Users can select whether to validate the API with frontend or backend ruleset depending on how they configure the OpenApiServiceProfile MSBuild property (backend (default) or frontend).

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.

About

Validates at build time that the OpenAPI specification files extracted from the ASP.NET Core Web API being built conform to Workleap API guidelines.

Resources

License

Security policy

Stars

Watchers

Forks