Skip to content

Commit ecbb87f

Browse files
.NET 10 preparation (#3285)
- Cherry-pick refactoring from #3283 to make multi-targeting easier for ASP.NET Core 10 and Microsoft.OpenApi v2. - Make Verify snapshots unique per target framework. This is to when .NET 10 introduces OpenAPI 3.1, it doesn't cause issues with the snapshots being intentionally different. - Apply IDE suggestion to use collection expressions. - Shorten test names to avoid `MAX_PATH` issues on Windows in GitHub Actions. - Bump coverlet, Microsoft.NET.Test.Sdk, ReportGenerator, and xunit to their latest stable versions. - Update more NuGet package version overrides for tests to the latest versions. - Drop leftover `net6.0` reference in tests.
1 parent 1d7aed0 commit ecbb87f

217 files changed

Lines changed: 7871 additions & 786 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/dependabot.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,6 @@ updates:
2424
- package-ecosystem: nuget
2525
directory: "/"
2626
groups:
27-
coverlet:
28-
patterns:
29-
- coverlet*
3027
Microsoft.OpenApi:
3128
patterns:
3229
- Microsoft.OpenApi*

Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
<ItemGroup Condition=" '$(PackageReadmeFile)' != '' ">
5959
<None Include="$(MSBuildThisFileDirectory)$(PackageReadmeFile)" Pack="True" PackagePath="" />
6060
</ItemGroup>
61-
<PropertyGroup Condition=" '$(SignAssembly)' == 'true' AND '$(OS)' != 'Windows_NT' ">
61+
<PropertyGroup Condition=" '$(SignAssembly)' == 'true' AND '$(OS)' != !$([MSBuild]::IsOSPlatform('Windows')) ">
6262
<PublicSign>true</PublicSign>
6363
</PropertyGroup>
6464
<PropertyGroup>

Directory.Packages.props

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<ItemGroup>
33
<PackageVersion Include="Autofac.Extensions.DependencyInjection" Version="10.0.0" />
44
<PackageVersion Include="BenchmarkDotNet" Version="0.14.0" />
5-
<PackageVersion Include="coverlet.msbuild" Version="6.0.2" />
5+
<PackageVersion Include="coverlet.msbuild" Version="6.0.4" />
66
<PackageVersion Include="GitHubActionsTestLogger" Version="2.4.1" />
77
<PackageVersion Include="IdentityServer4" Version="3.1.4" />
88
<PackageVersion Include="IdentityServer4.AccessTokenValidation" Version="3.0.1" />
@@ -23,15 +23,15 @@
2323
<PackageVersion Include="Microsoft.Extensions.FileProviders.Embedded" Version="2.1.0" />
2424
<PackageVersion Include="Microsoft.OpenApi" Version="1.6.22" />
2525
<PackageVersion Include="Microsoft.OpenApi.Readers" Version="1.6.22" />
26-
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
26+
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.13.0" />
2727
<PackageVersion Include="Newtonsoft.Json" Version="13.0.3" />
2828
<PackageVersion Include="NSubstitute" Version="5.3.0" />
2929
<PackageVersion Include="NSwag.MSBuild" Version="14.2.0" />
30-
<PackageVersion Include="ReportGenerator" Version="5.4.1" />
30+
<PackageVersion Include="ReportGenerator" Version="5.4.4" />
3131
<PackageVersion Include="System.Text.Json" Version="4.6.0" />
32-
<PackageVersion Include="Verify.Xunit" Version="28.3.2" />
33-
<PackageVersion Include="xunit" Version="2.9.2" />
34-
<PackageVersion Include="xunit.core" Version="2.9.2" />
35-
<PackageVersion Include="xunit.runner.visualstudio" Version="2.8.2" />
32+
<PackageVersion Include="Verify.Xunit" Version="28.16.0" />
33+
<PackageVersion Include="xunit" Version="2.9.3" />
34+
<PackageVersion Include="xunit.core" Version="2.9.3" />
35+
<PackageVersion Include="xunit.runner.visualstudio" Version="3.0.2" />
3636
</ItemGroup>
3737
</Project>

perf/Swashbuckle.AspNetCore.Benchmarks/Swashbuckle.AspNetCore.Benchmarks.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
<OutputType>Exe</OutputType>
55
<TargetFramework>net8.0</TargetFramework>
66
</PropertyGroup>
7+
<ItemGroup>
8+
<Compile Include="..\..\src\Shared\JsonSchemaTypes.cs" Link="JsonSchemaTypes.cs" />
9+
</ItemGroup>
710
<ItemGroup>
811
<ProjectReference Include="..\..\src\Swashbuckle.AspNetCore.Annotations\Swashbuckle.AspNetCore.Annotations.csproj" />
912
<ProjectReference Include="..\..\src\Swashbuckle.AspNetCore.SwaggerGen\Swashbuckle.AspNetCore.SwaggerGen.csproj" />

perf/Swashbuckle.AspNetCore.Benchmarks/XmlCommentsBenchmark.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ public void Setup()
101101
{
102102
Schema = new()
103103
{
104-
Type = "string",
104+
Type = JsonSchemaTypes.String,
105105
Description = "schema-level description",
106106
},
107107
};
@@ -120,7 +120,7 @@ public void Setup()
120120
{
121121
Schema = new()
122122
{
123-
Type = "string",
123+
Type = JsonSchemaTypes.String,
124124
},
125125
},
126126
},

src/Shared/JsonSchemaTypes.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
namespace Swashbuckle.AspNetCore;
2+
3+
internal static class JsonSchemaTypes
4+
{
5+
public const string Array = "array";
6+
public const string Boolean = "boolean";
7+
public const string Integer = "integer";
8+
public const string Number = "number";
9+
public const string Null = "null";
10+
public const string Object = "object";
11+
public const string String = "string";
12+
}

src/Swashbuckle.AspNetCore.Annotations/AnnotationsOperationFilter.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,7 @@ private static void ApplySwaggerOperationAttribute(
6565

6666
if (swaggerOperationAttribute.Tags != null)
6767
{
68-
operation.Tags = swaggerOperationAttribute.Tags
69-
.Select(tagName => new OpenApiTag { Name = tagName })
70-
.ToList();
68+
operation.Tags = [.. swaggerOperationAttribute.Tags.Select(tagName => new OpenApiTag { Name = tagName })];
7169
}
7270
}
7371

src/Swashbuckle.AspNetCore.Annotations/PublicAPI/PublicAPI.Shipped.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,6 @@ Swashbuckle.AspNetCore.Annotations.SwaggerRequestBodyAttribute.SwaggerRequestBod
4949
Swashbuckle.AspNetCore.Annotations.SwaggerResponseAttribute
5050
Swashbuckle.AspNetCore.Annotations.SwaggerResponseAttribute.ContentTypes.get -> string[]
5151
Swashbuckle.AspNetCore.Annotations.SwaggerResponseAttribute.ContentTypes.set -> void
52-
Swashbuckle.AspNetCore.Annotations.SwaggerResponseAttribute.Description.get -> string
53-
Swashbuckle.AspNetCore.Annotations.SwaggerResponseAttribute.Description.set -> void
5452
Swashbuckle.AspNetCore.Annotations.SwaggerResponseAttribute.SwaggerResponseAttribute(int statusCode, string description = null, System.Type type = null) -> void
5553
Swashbuckle.AspNetCore.Annotations.SwaggerResponseAttribute.SwaggerResponseAttribute(int statusCode, string description = null, System.Type type = null, params string[] contentTypes) -> void
5654
Swashbuckle.AspNetCore.Annotations.SwaggerSchemaAttribute
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Swashbuckle.AspNetCore.Annotations.SwaggerResponseAttribute.Description.get -> string
2+
Swashbuckle.AspNetCore.Annotations.SwaggerResponseAttribute.Description.set -> void

src/Swashbuckle.AspNetCore.Annotations/PublicAPI/net6.0/PublicAPI.Unshipped.txt

Whitespace-only changes.

0 commit comments

Comments
 (0)