Stenn.AspNetCore.Versioning.MSBuild.Swashbuckle 7.0.9

dotnet add package Stenn.AspNetCore.Versioning.MSBuild.Swashbuckle --version 7.0.9
                    
NuGet\Install-Package Stenn.AspNetCore.Versioning.MSBuild.Swashbuckle -Version 7.0.9
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Stenn.AspNetCore.Versioning.MSBuild.Swashbuckle" Version="7.0.9">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Stenn.AspNetCore.Versioning.MSBuild.Swashbuckle" Version="7.0.9" />
                    
Directory.Packages.props
<PackageReference Include="Stenn.AspNetCore.Versioning.MSBuild.Swashbuckle">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Stenn.AspNetCore.Versioning.MSBuild.Swashbuckle --version 7.0.9
                    
#r "nuget: Stenn.AspNetCore.Versioning.MSBuild.Swashbuckle, 7.0.9"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Stenn.AspNetCore.Versioning.MSBuild.Swashbuckle@7.0.9
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Stenn.AspNetCore.Versioning.MSBuild.Swashbuckle&version=7.0.9
                    
Install as a Cake Addin
#tool nuget:?package=Stenn.AspNetCore.Versioning.MSBuild.Swashbuckle&version=7.0.9
                    
Install as a Cake Tool

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

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

There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

  • net6.0

    • No dependencies.
  • net7.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 2,855 12/26/2022
7.0.8 8,455 12/26/2022
6.0.7 2,190 5/11/2022
6.0.0 843 3/16/2022
6.0.0-beta 658 3/16/2022
5.0.7 8,165 5/11/2022
5.0.6 2,378 3/16/2022
2.0.5 1,434 2/11/2022
2.0.4 839 2/11/2022
2.0.3 868 1/25/2022
2.0.3-beta 642 1/25/2022
2.0.2-beta 643 1/25/2022
2.0.1-beta5 654 1/18/2022
2.0.1-beta 677 1/17/2022
2.0.0-beta2 680 1/17/2022
1.0.24 1,281 1/24/2022
1.0.23 870 1/19/2022
1.0.22-beta4 654 1/17/2022
1.0.22-beta3 654 1/17/2022
1.0.22-beta 672 1/17/2022
Loading failed