Skip to content

Commit

Permalink
Added .NET 9 support (#28)
Browse files Browse the repository at this point in the history
Added .NET 9 support & .NET 7 out of support
  • Loading branch information
teociaps authored Nov 13, 2024
2 parents 879eb45 + c6c1f2e commit dcc4c4c
Show file tree
Hide file tree
Showing 11 changed files with 41 additions and 25 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ jobs:
6.0.x
7.0.x
8.0.x
9.0.x
- name: Restore
run: dotnet restore
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/pack_and_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ jobs:
6.0.x
7.0.x
8.0.x
9.0.x
- name: Pack & Push to NuGet
shell: pwsh
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ jobs:
6.0.x
7.0.x
8.0.x
9.0.x
- name: Test
run: dotnet test ${{ env.TEST_PROJECTS_PATH }} --configuration ${{ env.CONFIGURATION }}
10 changes: 4 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,6 @@ Change style to your API documentation in ASP.NET Core applications!
| [![NSwag Nuget Version]](https://www.nuget.org/packages/NSwag.AspNetCore.Themes/) | Customize the style for [NSwag.AspNetCore] |


> [!WARNING]
> Starting from v1.0.0 the namespace for pre-defined styles is `AspNetCore.Swagger.Themes` instead of `AspNetCore.SwaggerUI.Themes`!

## Features
- _New Themes_: enhances the Swagger documentation interface with various themes, including a default style that preserves the classic Swagger UI appearance and introduces new modern styles. Explore samples [here](#available-themes).
- _Seamless Integration_: simply install the package and add the style parameter to the existing method used for Swagger UI.
Expand All @@ -42,9 +38,11 @@ Change style to your API documentation in ASP.NET Core applications!
| Version | Status |
| ------- | ------ |
| .NET 6 | ![Badge](https://img.shields.io/badge/Status-Supported-brightgreen) |
| .NET 7 | ![Badge](https://img.shields.io/badge/Status-Supported-brightgreen) |
| .NET 7 | ![Badge](https://img.shields.io/badge/Status-Out%20of%20Support*-orange) |
| .NET 8 | ![Badge](https://img.shields.io/badge/Status-Supported-brightgreen) |
| .NET 9 | ![Badge](https://img.shields.io/badge/Status-Coming%20soon...-blue) |
| .NET 9 | ![Badge](https://img.shields.io/badge/Status-Supported-brightgreen) |

___* Still available but it won't receive any update. Upgrade your .NET version!___


## Swashbuckle.AspNetCore.SwaggerUI
Expand Down
4 changes: 2 additions & 2 deletions build/Common.Core.props
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<Project>

<PropertyGroup>
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
<LangVersion>12.0</LangVersion>
<TargetFrameworks>net6.0;net7.0;net8.0;net9.0</TargetFrameworks>
<LangVersion>13.0</LangVersion>
<ImplicitUsings>enable</ImplicitUsings>
<RootNamespace />
</PropertyGroup>
Expand Down
2 changes: 0 additions & 2 deletions build/Versioning.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<Project>

<!-- TODO: enhance configuration for 'Official' version -->

<!-- Local Development -->
<PropertyGroup Condition="'$(Configuration)' == 'Debug'">
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,12 @@
<OpenApiGeneratorDocumentsOnBuild>false</OpenApiGeneratorDocumentsOnBuild>
</PropertyGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net9.0' ">
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="9.0.0" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net8.0' ">
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="8.0.8" />
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="8.0.11" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net7.0' ">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,23 @@
<OpenApiGeneratorDocumentsOnBuild>false</OpenApiGeneratorDocumentsOnBuild>
</PropertyGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net8.0' ">
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="8.0.8" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.7.1" />
<ItemGroup Condition=" '$(TargetFramework)' == 'net9.0' ">
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="9.0.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="7.0.0" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net6.0' ">
<PackageReference Include="Swashbuckle.AspNetCore.Annotations" Version="6.7.1" />
<ItemGroup Condition=" '$(TargetFramework)' == 'net8.0' ">
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="8.0.11" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="7.0.0" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net7.0' ">
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="7.0.20" />
<PackageReference Include="Swashbuckle.AspNetCore.Annotations" Version="6.7.1" />
<PackageReference Include="Swashbuckle.AspNetCore.Annotations" Version="7.0.0" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net6.0' ">
<PackageReference Include="Swashbuckle.AspNetCore.Annotations" Version="7.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerUI" Version="6.7.1" />
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerUI" Version="7.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,21 @@
<EmbeddedResource Include="SwaggerThemes\style.css" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net7.0' ">
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="7.0.20" />
<PackageReference Include="System.Text.Json" Version="8.0.5" />
</ItemGroup>

<ItemGroup>
<PackageReference Condition=" '$(TargetFramework)' == 'net8.0' " Include="Microsoft.AspNetCore.Mvc.Testing" Version="8.0.8" />
<PackageReference Condition=" '$(TargetFramework)' == 'net7.0' " Include="Microsoft.AspNetCore.Mvc.Testing" Version="7.0.20" />
<PackageReference Condition=" '$(TargetFramework)' == 'net6.0' " Include="Microsoft.AspNetCore.Mvc.Testing" Version="6.0.32" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageReference Condition=" '$(TargetFramework)' == 'net9.0' " Include="Microsoft.AspNetCore.Mvc.Testing" Version="9.0.0" />
<PackageReference Condition=" '$(TargetFramework)' == 'net8.0' " Include="Microsoft.AspNetCore.Mvc.Testing" Version="8.0.11" />


<PackageReference Condition=" '$(TargetFramework)' == 'net6.0' " Include="Microsoft.AspNetCore.Mvc.Testing" Version="6.0.36" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="Shouldly" Version="4.2.1" />
<PackageReference Include="xunit" Version="2.9" />

<PackageReference Include="xunit" Version="2.9.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
Expand All @@ -32,6 +40,7 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>

</ItemGroup>

<ItemGroup>
Expand Down
3 changes: 1 addition & 2 deletions tests/AspNetCore.SwaggerUI.Themes.Tests/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@

void RegisterTestStyleEndpoint()
{
foreach (var item in new StyleTestData())
foreach (var style in new StyleTestData())
{
var style = (BaseStyle)item[0];
var fullPath = StylesPath + style.FileName;
AddGetEndpoint(app, fullPath, GetResourceText(style.FileName, style.GetType()));
if (style is ModernStyle modernStyle && modernStyle.LoadAdditionalJs)
Expand Down

0 comments on commit dcc4c4c

Please sign in to comment.