-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathArmSwashbuckleStarterKit.csproj
29 lines (23 loc) · 1.27 KB
/
ArmSwashbuckleStarterKit.csproj
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
</PropertyGroup>
<!--Include the needed Swashbuckle packages-->
<ItemGroup>
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.2.3" />
<PackageReference Include="Swashbuckle.AspNetCore.Annotations" Version="6.2.3" />
<!--Only needed if using Newtonsoft.Json as a serializer-->
<PackageReference Include="Swashbuckle.AspNetCore.Newtonsoft" Version="6.2.3" />
</ItemGroup>
<!--Enable XML comments for Swashbuckle https://docs.microsoft.com/en-us/aspnet/core/tutorials/getting-started-with-swashbuckle?view=aspnetcore-6.0&tabs=visual-studio#xml-comments-->
<PropertyGroup>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<NoWarn>$(NoWarn);1591</NoWarn>
</PropertyGroup>
<!--After each build, generate Swagger JSON file and copy to docs directory for API documentation-->
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Exec Command="dotnet tool restore" />
<!--ARM requires OpenAPI version 2.0 instead of the default 3.0-->
<Exec Command="dotnet swagger tofile --output $(MSBuildProjectDirectory)\swagger.json --serializeasv2 $(OutDir)ArmSwashbuckleStarterKit.dll v1" />
</Target>
</Project>