Skip to content

Commit

Permalink
Update to match LGTM on Contract-First with annotation (#44)
Browse files Browse the repository at this point in the history
* Replace Code-First and Contrcat-First with GenerateContract and ValidateContract with default to GenerateContract

* Resolve PR Comments

* Fix review
  • Loading branch information
decarufe authored Mar 27, 2024
1 parent b814c43 commit 131476d
Show file tree
Hide file tree
Showing 33 changed files with 603 additions and 77 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

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:
Depending if the user chose the ValidateContract or GenerateContract development mode this MSBuild task will:

- Install tools: [OasDiff](https://github.com/Tufin/oasdiff), [Spectral](https://github.com/stoplightio/spectral), [SwashbuckleCLI](https://github.com/domaindrivendev/Swashbuckle.AspNetCore?tab=readme-ov-file#swashbuckleaspnetcorecli)
- Generate the OpenAPI specification file from the associated Web API
Expand Down
33 changes: 23 additions & 10 deletions Run-SystemTest.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,25 @@ Process {
[bool]$isFailureExpected,
[string]$extraArgs
)
Push-Location $projectPath

Exec { & dotnet add package Workleap.OpenApi.MSBuild --prerelease --source $openApiMsBuildSource }

$buildProcess = Start-Process -FilePath "dotnet" -ArgumentList "build -c Release $extraArgs" -NoNewWindow -PassThru -Wait

if ($isFailureExpected -and $buildProcess.ExitCode -eq 0 ) {
Write-Error "The build for project $projectPath was expected to fail, but it succeeded."
} elseif (!$isFailureExpected -and $buildProcess.ExitCode -ne 0) {
Write-Error "The build for project $projectPath was expected to succeed, but it failed."
try
{
Push-Location $projectPath

Exec { & dotnet add package Workleap.OpenApi.MSBuild --prerelease --source $openApiMsBuildSource }

$buildProcess = Start-Process -FilePath "dotnet" -ArgumentList "build -c Release $extraArgs" -NoNewWindow -PassThru -Wait

Exec { & dotnet remove package Workleap.OpenApi.MSBuild }

if ($isFailureExpected -and $buildProcess.ExitCode -eq 0 ) {
Write-Error "The build for project $projectPath was expected to fail, but it succeeded."
} elseif (!$isFailureExpected -and $buildProcess.ExitCode -ne 0) {
Write-Error "The build for project $projectPath was expected to succeed, but it failed."
}
}
finally {
Pop-Location
}
}

Expand All @@ -36,7 +45,9 @@ Process {
$outputDir = Join-Path $PSScriptRoot ".output"

$contractFirstSysTestDir = Join-Path $PSScriptRoot "src/tests/WebApi.MsBuild.SystemTest.ContractFirst"
$validateContractSysTestDir = Join-Path $PSScriptRoot "src/tests/WebApi.MsBuild.SystemTest.ValidateContract"
$codeFirstSysTestDir = Join-Path $PSScriptRoot "src/tests/WebApi.MsBuild.SystemTest.CodeFirst"
$generateContractSysTestDir = Join-Path $PSScriptRoot "src/tests/WebApi.MsBuild.SystemTest.GenerateContract"
$oasDiffErrorSysTestDir = Join-Path $PSScriptRoot "src/tests/WebApi.MsBuild.SystemTest.OasDiffError"
$spectralErrorSysTestDir = Join-Path $PSScriptRoot "src/tests/WebApi.MsBuild.SystemTest.SpectralError"

Expand All @@ -47,14 +58,16 @@ Process {
Exec { & dotnet pack -c Release -o "$outputDir" }

BuildProject -openApiMsBuildSource $outputDir -projectPath $contractFirstSysTestDir -isFailureExpected $false
BuildProject -openApiMsBuildSource $outputDir -projectPath $validateContractSysTestDir -isFailureExpected $false
BuildProject -openApiMsBuildSource $outputDir -projectPath $codeFirstSysTestDir -isFailureExpected $false
BuildProject -openApiMsBuildSource $outputDir -projectPath $generateContractSysTestDir -isFailureExpected $false
BuildProject -openApiMsBuildSource $outputDir -projectPath $oasDiffErrorSysTestDir -isFailureExpected $true
BuildProject -openApiMsBuildSource $outputDir -projectPath $spectralErrorSysTestDir -isFailureExpected $true
BuildProject -openApiMsBuildSource $outputDir -projectPath $oasDiffErrorSysTestDir -isFailureExpected $false -extraArgs "/p:OpenApiTreatWarningsAsErrors=false"
BuildProject -openApiMsBuildSource $outputDir -projectPath $spectralErrorSysTestDir -isFailureExpected $false -extraArgs "/p:OpenApiTreatWarningsAsErrors=false"
}
finally {
Pop-Location

Pop-Location
}
}
18 changes: 9 additions & 9 deletions src/WebApiDebugger/Properties/launchSettings.json
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
{
{
"$schema": "https://json.schemastore.org/launchsettings.json",
"profiles": {
"ContractFirstWithoutCompare": {
"ValidateContractWithoutCompare": {
"commandName": "Executable",
"executablePath": "dotnet",
"commandLineArgs": "msbuild /t:ValidateOpenApi /p:OpenApiDevelopmentMode=ContractFirst /p:OpenApiCompareCodeAgainstSpecFile=false",
"commandLineArgs": "msbuild /t:ValidateOpenApi /p:OpenApiDevelopmentMode=ValidateContract /p:OpenApiCompareCodeAgainstSpecFile=false",
"workingDirectory": "$(ProjectDir)"
},
"ContractFirstWithCompare": {
"ValidateContractWithCompare": {
"commandName": "Executable",
"executablePath": "dotnet",
"commandLineArgs": "msbuild /t:ValidateOpenApi /p:OpenApiDevelopmentMode=ContractFirst /p:OpenApiCompareCodeAgainstSpecFile=true",
"commandLineArgs": "msbuild /t:ValidateOpenApi /p:OpenApiDevelopmentMode=ValidateContract /p:OpenApiCompareCodeAgainstSpecFile=true",
"workingDirectory": "$(ProjectDir)"
},
"CodeFirst": {
"GenerateContract": {
"commandName": "Executable",
"executablePath": "dotnet",
"commandLineArgs": "msbuild /t:ValidateOpenApi /p:OpenApiDevelopmentMode=CodeFirst",
"commandLineArgs": "msbuild /t:ValidateOpenApi /p:OpenApiDevelopmentMode=GenerateContract",
"workingDirectory": "$(ProjectDir)"
},
"CodeFirstOnCI": {
"GenerateContractOnCI": {
"commandName": "Executable",
"executablePath": "dotnet",
"commandLineArgs": "msbuild /t:ValidateOpenApi /p:OpenApiDevelopmentMode=CodeFirst /p:OpenApiCompareCodeAgainstSpecFile=true",
"commandLineArgs": "msbuild /t:ValidateOpenApi /p:OpenApiDevelopmentMode=GenerateContract /p:OpenApiCompareCodeAgainstSpecFile=true",
"workingDirectory": "$(ProjectDir)"
},
"WebApiDebugger": {
Expand Down
2 changes: 1 addition & 1 deletion src/WebApiDebugger/WebApiDebugger.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

<PropertyGroup>
<OpenApiDebuggingEnabled>true</OpenApiDebuggingEnabled>
<OpenApiDevelopmentMode>CodeFirst</OpenApiDevelopmentMode>
<OpenApiDevelopmentMode>GenerateContract</OpenApiDevelopmentMode>
</PropertyGroup>

<ItemGroup>
Expand Down
59 changes: 38 additions & 21 deletions src/Workleap.OpenApi.MSBuild.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,38 +3,39 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.31903.59
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Workleap.OpenApi.MSBuild", "Workleap.OpenApi.MSBuild\Workleap.OpenApi.MSBuild.csproj", "{4479DD41-F9CE-4DFD-8F7C-4ACC25BE203C}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Workleap.OpenApi.MSBuild", "Workleap.OpenApi.MSBuild\Workleap.OpenApi.MSBuild.csproj", "{4479DD41-F9CE-4DFD-8F7C-4ACC25BE203C}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "files", "files", "{3B3625CC-919B-4216-9B50-BCFE297AA184}"
ProjectSection(SolutionItems) = preProject
Directory.Build.props = Directory.Build.props
.editorconfig = .editorconfig
Directory.Build.props = Directory.Build.props
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Workleap.OpenApi.MSBuild.Tests", "Workleap.OpenApi.MSBuild.Tests\Workleap.OpenApi.MSBuild.Tests.csproj", "{2A5429CC-E179-47E7-85BB-C1E33E2AFD8A}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Workleap.OpenApi.MSBuild.Tests", "Workleap.OpenApi.MSBuild.Tests\Workleap.OpenApi.MSBuild.Tests.csproj", "{2A5429CC-E179-47E7-85BB-C1E33E2AFD8A}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "debug", "debug", "{07F66FC2-73B9-44C7-843C-36C13905AE9B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebApiDebugger", "WebApiDebugger\WebApiDebugger.csproj", "{A4C90BE2-889F-46BB-8B4D-2219B1084695}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WebApiDebugger", "WebApiDebugger\WebApiDebugger.csproj", "{A4C90BE2-889F-46BB-8B4D-2219B1084695}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{4DDE83BF-D190-4CC9-AD36-E9250DABB27D}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebApi.MsBuild.SystemTest.ContractFirst", "tests\WebApi.MsBuild.SystemTest.ContractFirst\WebApi.MsBuild.SystemTest.ContractFirst.csproj", "{B8A81C76-574B-40FD-B34B-FA893D6C1423}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WebApi.MsBuild.SystemTest.OasDiffError", "tests\WebApi.MsBuild.SystemTest.OasDiffError\WebApi.MsBuild.SystemTest.OasDiffError.csproj", "{3909D38E-7584-4206-9CDC-3E56203BE6DB}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WebApi.MsBuild.SystemTest.SpectralError", "tests\WebApi.MsBuild.SystemTest.SpectralError\WebApi.MsBuild.SystemTest.SpectralError.csproj", "{C42C2836-4997-49D3-9BC6-E6A0E1B8C472}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebApi.MsBuild.SystemTest.CodeFirst", "tests\WebApi.MsBuild.SystemTest.CodeFirst\WebApi.MsBuild.SystemTest.CodeFirst.csproj", "{575E14D8-52E8-4B5B-A93C-D3E86E30BD3C}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WebApi.MsBuild.SystemTest.ValidateContract", "tests\WebApi.MsBuild.SystemTest.ValidateContract\WebApi.MsBuild.SystemTest.ValidateContract.csproj", "{CCDEB7C9-EE1C-416D-871B-00FD8269B5FA}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebApi.MsBuild.SystemTest.OasDiffError", "tests\WebApi.MsBuild.SystemTest.OasDiffError\WebApi.MsBuild.SystemTest.OasDiffError.csproj", "{3909D38E-7584-4206-9CDC-3E56203BE6DB}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WebApi.MsBuild.SystemTest.GenerateContract", "tests\WebApi.MsBuild.SystemTest.GenerateContract\WebApi.MsBuild.SystemTest.GenerateContract.csproj", "{502CEF5F-350E-4498-BA3C-3C09C9620737}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebApi.MsBuild.SystemTest.SpectralError", "tests\WebApi.MsBuild.SystemTest.SpectralError\WebApi.MsBuild.SystemTest.SpectralError.csproj", "{C42C2836-4997-49D3-9BC6-E6A0E1B8C472}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WebApi.MsBuild.SystemTest.CodeFirst", "tests\WebApi.MsBuild.SystemTest.CodeFirst\WebApi.MsBuild.SystemTest.CodeFirst.csproj", "{49EEB542-9B68-4389-810D-0C1222E5FD17}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WebApi.MsBuild.SystemTest.ContractFirst", "tests\WebApi.MsBuild.SystemTest.ContractFirst\WebApi.MsBuild.SystemTest.ContractFirst.csproj", "{DE929AE5-5A69-4E82-8246-7AD5BF97983B}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{4479DD41-F9CE-4DFD-8F7C-4ACC25BE203C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4479DD41-F9CE-4DFD-8F7C-4ACC25BE203C}.Debug|Any CPU.Build.0 = Debug|Any CPU
Expand All @@ -48,14 +49,6 @@ Global
{A4C90BE2-889F-46BB-8B4D-2219B1084695}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A4C90BE2-889F-46BB-8B4D-2219B1084695}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A4C90BE2-889F-46BB-8B4D-2219B1084695}.Release|Any CPU.Build.0 = Release|Any CPU
{B8A81C76-574B-40FD-B34B-FA893D6C1423}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B8A81C76-574B-40FD-B34B-FA893D6C1423}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B8A81C76-574B-40FD-B34B-FA893D6C1423}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B8A81C76-574B-40FD-B34B-FA893D6C1423}.Release|Any CPU.Build.0 = Release|Any CPU
{575E14D8-52E8-4B5B-A93C-D3E86E30BD3C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{575E14D8-52E8-4B5B-A93C-D3E86E30BD3C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{575E14D8-52E8-4B5B-A93C-D3E86E30BD3C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{575E14D8-52E8-4B5B-A93C-D3E86E30BD3C}.Release|Any CPU.Build.0 = Release|Any CPU
{3909D38E-7584-4206-9CDC-3E56203BE6DB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3909D38E-7584-4206-9CDC-3E56203BE6DB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3909D38E-7584-4206-9CDC-3E56203BE6DB}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand All @@ -64,12 +57,36 @@ Global
{C42C2836-4997-49D3-9BC6-E6A0E1B8C472}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C42C2836-4997-49D3-9BC6-E6A0E1B8C472}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C42C2836-4997-49D3-9BC6-E6A0E1B8C472}.Release|Any CPU.Build.0 = Release|Any CPU
{CCDEB7C9-EE1C-416D-871B-00FD8269B5FA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{CCDEB7C9-EE1C-416D-871B-00FD8269B5FA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CCDEB7C9-EE1C-416D-871B-00FD8269B5FA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CCDEB7C9-EE1C-416D-871B-00FD8269B5FA}.Release|Any CPU.Build.0 = Release|Any CPU
{502CEF5F-350E-4498-BA3C-3C09C9620737}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{502CEF5F-350E-4498-BA3C-3C09C9620737}.Debug|Any CPU.Build.0 = Debug|Any CPU
{502CEF5F-350E-4498-BA3C-3C09C9620737}.Release|Any CPU.ActiveCfg = Release|Any CPU
{502CEF5F-350E-4498-BA3C-3C09C9620737}.Release|Any CPU.Build.0 = Release|Any CPU
{49EEB542-9B68-4389-810D-0C1222E5FD17}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{49EEB542-9B68-4389-810D-0C1222E5FD17}.Debug|Any CPU.Build.0 = Debug|Any CPU
{49EEB542-9B68-4389-810D-0C1222E5FD17}.Release|Any CPU.ActiveCfg = Release|Any CPU
{49EEB542-9B68-4389-810D-0C1222E5FD17}.Release|Any CPU.Build.0 = Release|Any CPU
{DE929AE5-5A69-4E82-8246-7AD5BF97983B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DE929AE5-5A69-4E82-8246-7AD5BF97983B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DE929AE5-5A69-4E82-8246-7AD5BF97983B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DE929AE5-5A69-4E82-8246-7AD5BF97983B}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{A4C90BE2-889F-46BB-8B4D-2219B1084695} = {07F66FC2-73B9-44C7-843C-36C13905AE9B}
{B8A81C76-574B-40FD-B34B-FA893D6C1423} = {4DDE83BF-D190-4CC9-AD36-E9250DABB27D}
{575E14D8-52E8-4B5B-A93C-D3E86E30BD3C} = {4DDE83BF-D190-4CC9-AD36-E9250DABB27D}
{3909D38E-7584-4206-9CDC-3E56203BE6DB} = {4DDE83BF-D190-4CC9-AD36-E9250DABB27D}
{C42C2836-4997-49D3-9BC6-E6A0E1B8C472} = {4DDE83BF-D190-4CC9-AD36-E9250DABB27D}
{CCDEB7C9-EE1C-416D-871B-00FD8269B5FA} = {4DDE83BF-D190-4CC9-AD36-E9250DABB27D}
{502CEF5F-350E-4498-BA3C-3C09C9620737} = {4DDE83BF-D190-4CC9-AD36-E9250DABB27D}
{49EEB542-9B68-4389-810D-0C1222E5FD17} = {4DDE83BF-D190-4CC9-AD36-E9250DABB27D}
{DE929AE5-5A69-4E82-8246-7AD5BF97983B} = {4DDE83BF-D190-4CC9-AD36-E9250DABB27D}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {BCD029BE-FB3E-45A2-8DD4-FDE33D87544D}
EndGlobalSection
EndGlobal
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
namespace Workleap.OpenApi.MSBuild;
namespace Workleap.OpenApi.MSBuild;

/// <summary>
/// For a Code First approach it will:
/// For a GenerateContract approach it will:
/// 1. Generate the OpenAPI specification files from the code
/// 2. Depending of <see cref="CodeFirstMode"/> it will either will compare the generated OpenAPI specification files against the provided specifications or it will update the source-controlled specification files
/// 2. Depending of <see cref="GenerateContractMode"/> it will either will compare the generated OpenAPI specification files against the provided specifications or it will update the source-controlled specification files
/// 2. Validate the OpenAPI specification files base on spectral rules
/// </summary>
internal class CodeFirstProcess
internal class GenerateContractProcess
{
private readonly ILoggerWrapper _loggerWrapper;
private readonly SpectralManager _spectralManager;
private readonly SwaggerManager _swaggerManager;
private readonly SpecGeneratorManager _specGeneratorManager;
private readonly OasdiffManager _oasdiffManager;

internal CodeFirstProcess(ILoggerWrapper loggerWrapper, SpectralManager spectralManager, SwaggerManager swaggerManager, SpecGeneratorManager specGeneratorManager, OasdiffManager oasdiffManager)
internal GenerateContractProcess(ILoggerWrapper loggerWrapper, SpectralManager spectralManager, SwaggerManager swaggerManager, SpecGeneratorManager specGeneratorManager, OasdiffManager oasdiffManager)
{
this._loggerWrapper = loggerWrapper;
this._spectralManager = spectralManager;
Expand All @@ -23,7 +23,7 @@ internal CodeFirstProcess(ILoggerWrapper loggerWrapper, SpectralManager spectral
this._oasdiffManager = oasdiffManager;
}

internal enum CodeFirstMode
internal enum GenerateContractMode
{
SpecGeneration,
SpecComparison,
Expand All @@ -33,7 +33,7 @@ internal async Task Execute(
string[] openApiSpecificationFilesPath,
string[] openApiSwaggerDocumentNames,
string openApiSpectralRulesetUrl,
CodeFirstMode mode,
GenerateContractMode mode,
CancellationToken cancellationToken)
{
this._loggerWrapper.LogMessage("Installing dependencies...");
Expand All @@ -42,7 +42,7 @@ internal async Task Execute(
this._loggerWrapper.LogMessage("Running Swagger...");
var generateOpenApiDocsPath = (await this._swaggerManager.RunSwaggerAsync(openApiSwaggerDocumentNames, cancellationToken)).ToList();

if (mode == CodeFirstMode.SpecGeneration)
if (mode == GenerateContractMode.SpecGeneration)
{
this._loggerWrapper.LogMessage("Generating specification files...");
await this._specGeneratorManager.UpdateSpecificationFilesAsync(openApiSpecificationFilesPath, generateOpenApiDocsPath, cancellationToken);
Expand All @@ -58,14 +58,14 @@ internal async Task Execute(
}

private async Task InstallDependencies(
CodeFirstMode mode,
GenerateContractMode mode,
CancellationToken cancellationToken)
{
var installationTasks = new List<Task>();
installationTasks.Add(this._spectralManager.InstallSpectralAsync(cancellationToken));
installationTasks.Add(this._swaggerManager.InstallSwaggerCliAsync(cancellationToken));

if (mode == CodeFirstMode.SpecComparison)
if (mode == GenerateContractMode.SpecComparison)
{
installationTasks.Add(this._oasdiffManager.InstallOasdiffAsync(cancellationToken));
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
namespace Workleap.OpenApi.MSBuild;
namespace Workleap.OpenApi.MSBuild;

/// <summary>
/// For a Contract First approach it will:
/// For a ValidateContract approach it will:
/// 1. Validate the OpenAPI specification files base on spectral rules
/// 2. If <see cref="CompareCodeAgainstSpecFile"/> is enabled, will generate the OpenAPI specification files from the code and validate if it match the provided specifications.
/// </summary>
internal class ContractFirstProcess
internal class ValidateContractProcess
{
private readonly ILoggerWrapper _loggerWrapper;
private readonly SpectralManager _spectralManager;
private readonly SwaggerManager _swaggerManager;
private readonly OasdiffManager _oasdiffManager;

internal ContractFirstProcess(ILoggerWrapper loggerWrapper, SpectralManager spectralManager, SwaggerManager swaggerManager, OasdiffManager oasdiffManager)
internal ValidateContractProcess(ILoggerWrapper loggerWrapper, SpectralManager spectralManager, SwaggerManager swaggerManager, OasdiffManager oasdiffManager)
{
this._loggerWrapper = loggerWrapper;
this._spectralManager = spectralManager;
Expand Down
Loading

0 comments on commit 131476d

Please sign in to comment.