Skip to content

Commit

Permalink
[IDP-869] Add an option to disable the ValidateOpenApi target (#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
meziantou authored Jan 29, 2024
1 parent 21bb8ba commit 35b1ec5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/WebApiDebugger/WebApiDebugger.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<ImplicitUsings>enable</ImplicitUsings>
<IsPackable>false</IsPackable>
<WarnOnPackingNonPackableProject>false</WarnOnPackingNonPackableProject>
<OpenApiEnabled>true</OpenApiEnabled>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<OpenApiEnabled Condition="'$(OpenApiEnabled)' == ''">true</OpenApiEnabled>

<!-- We use this property when developing this MSBuild task in an IDE, -->
<!-- so we can reference the task assembly that is built in its bin folder instead of the one in the distributed NuGet package -->
<OpenApiDebuggingEnabled Condition="'$(OpenApiDebuggingEnabled)' == ''">false</OpenApiDebuggingEnabled>
<OpenApiDebuggingEnabled Condition="'$(OpenApiDebuggingEnabled)' == ''">false</OpenApiDebuggingEnabled>
</PropertyGroup>

<!-- This is the location of this task assembly when it is distributed as a NuGet package -->
Expand All @@ -13,7 +15,7 @@
<UsingTask Condition="'$(OpenApiDebuggingEnabled)' == 'true'" TaskName="$(MSBuildThisFileName).ValidateOpenApiTask" AssemblyFile="$(MSBuildThisFileDirectory)..\..\bin\$(Configuration)\netstandard2.0\$(MSBuildThisFileName).dll" />

<!-- We can only analyze the OpenAPI spec after the project has been built -->
<Target Name="ValidateOpenApi" DependsOnTargets="ResolveProjectReferences" AfterTargets="Build">
<Target Name="ValidateOpenApi" DependsOnTargets="ResolveProjectReferences" AfterTargets="Build" Condition="'$(OpenApiEnabled)' == 'true'">
<PropertyGroup>
<!-- Set development mode: ContractFirst or CodeFirst -->
<OpenApiDevelopmentMode Condition="'$(OpenApiDevelopmentMode)' == ''">ContractFirst</OpenApiDevelopmentMode>
Expand Down

0 comments on commit 35b1ec5

Please sign in to comment.