Stenn.AspNetCore.Versioning.MSBuild.Swashbuckle
1.0.22-beta4
See the version list below for details.
dotnet add package Stenn.AspNetCore.Versioning.MSBuild.Swashbuckle --version 1.0.22-beta4
NuGet\Install-Package Stenn.AspNetCore.Versioning.MSBuild.Swashbuckle -Version 1.0.22-beta4
<PackageReference Include="Stenn.AspNetCore.Versioning.MSBuild.Swashbuckle" Version="1.0.22-beta4"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
paket add Stenn.AspNetCore.Versioning.MSBuild.Swashbuckle --version 1.0.22-beta4
#r "nuget: Stenn.AspNetCore.Versioning.MSBuild.Swashbuckle, 1.0.22-beta4"
// Install Stenn.AspNetCore.Versioning.MSBuild.Swashbuckle as a Cake Addin #addin nuget:?package=Stenn.AspNetCore.Versioning.MSBuild.Swashbuckle&version=1.0.22-beta4&prerelease // Install Stenn.AspNetCore.Versioning.MSBuild.Swashbuckle as a Cake Tool #tool nuget:?package=Stenn.AspNetCore.Versioning.MSBuild.Swashbuckle&version=1.0.22-beta4&prerelease
MSBuild target to run Swashbuckle cli for generate open api specification
This package contains MSBuild target SwaggerGen_GenerateOpenApi to run Swashbuckle cli for generate open api specification during building ASP.Net Core project
Prerequisites
- Swashbuckle Gen must be configured for ASP.NET Core project
- Swashbuckle cli must be installed as a tool for dotnet cli
Configuration
- Add ApiVersions.props file to project's root folder with next content
<Project>
<PropertyGroup>
<RunSwaggerGen>True</RunSwaggerGen>
<SwaggerGenOutputDirectory>open-api</SwaggerGenOutputDirectory>
<SwaggerGenOutputDirectoryRecreate>True</SwaggerGenOutputDirectoryRecreate>
<SwaggerGenJsonOutput>True</SwaggerGenJsonOutput>
<SwaggerGenYamlOutput>False</SwaggerGenYamlOutput>
<SwaggerGenFileNamePrefix>$(MSBuildProjectName).openapi.</SwaggerGenFileNamePrefix>
</PropertyGroup>
<ItemGroup>
<Folder Include="$(SwaggerGenOutputDirectory)"/>
</ItemGroup>
<ItemGroup>
<ApiVersion Include="v1" Major="1" Minor="0" Depricated="false" IsDefault="true" />
</ItemGroup>
</Project>
I failed to found a way how to copy file during nuget package installation. If you know a way, please share it with me
Add ApiVersion for every api version in ASP.NET core project
For Swashbuckle cli only Include is metter in ApiVersion item. Other item's metadata value for versioning source generator
##Result
After building the project you will find open api specs file(s) in $(ProjectDirectory)$(SwaggerGenOutputDirectory) destination
Learn more about Target Frameworks and .NET Standard.
-
.NETStandard 2.0
- No dependencies.
-
net5.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
7.0.9 | 1,876 | 12/26/2022 |
7.0.8 | 8,048 | 12/26/2022 |
6.0.7 | 1,739 | 5/11/2022 |
6.0.0 | 421 | 3/16/2022 |
6.0.0-beta | 241 | 3/16/2022 |
5.0.7 | 7,720 | 5/11/2022 |
5.0.6 | 1,945 | 3/16/2022 |
2.0.5 | 1,010 | 2/11/2022 |
2.0.4 | 411 | 2/11/2022 |
2.0.3 | 444 | 1/25/2022 |
2.0.3-beta | 210 | 1/25/2022 |
2.0.2-beta | 213 | 1/25/2022 |
2.0.1-beta5 | 232 | 1/18/2022 |
2.0.1-beta | 238 | 1/17/2022 |
2.0.0-beta2 | 239 | 1/17/2022 |
2.0.0-beta | 286 | 1/17/2022 |
1.0.24 | 824 | 1/24/2022 |
1.0.23 | 442 | 1/19/2022 |
1.0.22 | 664 | 1/12/2022 |
1.0.22-beta4 | 216 | 1/17/2022 |
1.0.22-beta3 | 224 | 1/17/2022 |
1.0.22-beta | 254 | 1/17/2022 |
1.0.21 | 1,118 | 12/5/2021 |
1.0.20 | 926 | 10/20/2021 |
1.0.20-beta | 227 | 10/20/2021 |