From fb00c5947c7520cd8e2616b54e0c4de8c339c415 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 13 Jun 2025 18:20:16 +0100 Subject: [PATCH 01/84] Bump version (#3461) Bump version to 9.0.2 for the next release. Co-authored-by: github-actions[bot] --- Directory.Build.props | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index 12559360d3..c66230d93b 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -33,7 +33,7 @@ package-readme.md See $(PackageProjectUrl)/releases for details. false - 9.0.0 + 9.0.1 true git $(PackageProjectUrl).git @@ -41,7 +41,7 @@ snupkg true true - 9.0.1 + 9.0.2 false From 7bf6c091c7905ea7e60a1f74c43c6568f8b663b4 Mon Sep 17 00:00:00 2001 From: martincostello Date: Fri, 13 Jun 2025 19:04:15 +0100 Subject: [PATCH 02/84] .NET 10 preparation Cherry-pick various changes from #3283. --- .github/dependabot.yml | 9 --------- Directory.Build.props | 4 ---- Directory.Packages.props | 1 - exclusion.dic | 1 + global.json | 3 ++- .../ApiTestRunnerBase.cs | 2 +- .../DependencyInjection/SwaggerGenOptionsExtensions.cs | 1 - src/Swashbuckle.AspNetCore/Swashbuckle.AspNetCore.csproj | 7 +------ src/Swashbuckle.AspNetCore/Swashbuckle.AspNetCore.nuspec | 4 ++-- .../VerifyTests.cs | 8 ++++---- .../NewtonsoftSerializerTesting.cs | 8 +++++--- .../ApiDescriptionExtensionsTests.cs | 2 +- .../JsonSerializerTesting.cs | 8 +++++--- .../JsonSerializerSchemaGeneratorTests.cs | 2 +- .../XmlComments/XmlCommentsOperationFilterTests.cs | 6 +++--- test/WebSites/Basic/Controllers/CrudActionsController.cs | 1 - .../WebSites/TestFirst.IntegrationTests/ApiTestsSetup.cs | 5 ++--- test/WebSites/WebApi/EndPoints/OpenApiEndpoints.cs | 2 +- 18 files changed, 29 insertions(+), 45 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index c4e7db2d9a..cce780733f 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -40,17 +40,8 @@ updates: # Ignore the libraries which are "pinned" - dependency-name: "IdentityServer4" - dependency-name: "IdentityServer4.AccessTokenValidation" - - dependency-name: "Microsoft.AspNetCore" - - dependency-name: "Microsoft.AspNetCore.App" - - dependency-name: "Microsoft.AspNetCore.Mvc.ApiExplorer" - - dependency-name: "Microsoft.AspNetCore.Mvc.DataAnnotations" - - dependency-name: "Microsoft.AspNetCore.Mvc.Formatters.Json" - dependency-name: "Microsoft.AspNetCore.Mvc.NewtonsoftJson" - dependency-name: "Microsoft.AspNetCore.Mvc.Testing" - - dependency-name: "Microsoft.AspNetCore.Routing" - - dependency-name: "Microsoft.AspNetCore.StaticFiles" - - dependency-name: "Microsoft.Extensions.FileProviders.Embedded" - dependency-name: "Microsoft.OpenApi" - dependency-name: "Microsoft.OpenApi.Readers" - - dependency-name: "System.Text.Json" - dependency-name: "xunit" diff --git a/Directory.Build.props b/Directory.Build.props index c66230d93b..11579634ff 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -18,10 +18,6 @@ latest true en-US - - $(NoWarn);NU5128 direct + + <_SdkTasksTFM Condition=" '$(MSBuildRuntimeType)' == 'Core'">net9.0 + <_SdkTasksTFM Condition=" '$(MSBuildRuntimeType)' != 'Core'">net472 + + + + + + + + + + + + + + + + + + diff --git a/src/Swashbuckle.AspNetCore.SwaggerUI/SwaggerUIMiddleware.cs b/src/Swashbuckle.AspNetCore.SwaggerUI/SwaggerUIMiddleware.cs index 1ebb7edcd5..805118149c 100644 --- a/src/Swashbuckle.AspNetCore.SwaggerUI/SwaggerUIMiddleware.cs +++ b/src/Swashbuckle.AspNetCore.SwaggerUI/SwaggerUIMiddleware.cs @@ -1,16 +1,10 @@ using System.Diagnostics.CodeAnalysis; +using System.Reflection; +using System.Security.Cryptography; using System.Text; using System.Text.Json; using System.Text.RegularExpressions; -using Microsoft.AspNetCore.Builder; -using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.StaticFiles; -using Microsoft.Extensions.FileProviders; -using Microsoft.Extensions.Logging; -using Microsoft.Extensions.Options; -using System.Reflection; -using System.Security.Cryptography; namespace Swashbuckle.AspNetCore.SwaggerUI; @@ -20,24 +14,26 @@ internal sealed partial class SwaggerUIMiddleware private static readonly string SwaggerUIVersion = GetSwaggerUIVersion(); + private readonly RequestDelegate _next; private readonly SwaggerUIOptions _options; - private readonly StaticFileMiddleware _staticFileMiddleware; private readonly JsonSerializerOptions _jsonSerializerOptions; + private readonly CompressedEmbeddedFileResponder _compressedEmbeddedFileResponder; + public SwaggerUIMiddleware( RequestDelegate next, - IWebHostEnvironment hostingEnv, - ILoggerFactory loggerFactory, SwaggerUIOptions options) { + _next = next ?? throw new ArgumentNullException(nameof(next)); _options = options ?? new SwaggerUIOptions(); - _staticFileMiddleware = CreateStaticFileMiddleware(next, hostingEnv, loggerFactory, options); - if (options.JsonSerializerOptions != null) { _jsonSerializerOptions = options.JsonSerializerOptions; } + + var pathPrefix = options.RoutePrefix.StartsWith('/') ? options.RoutePrefix : $"/{options.RoutePrefix}"; + _compressedEmbeddedFileResponder = new(typeof(SwaggerUIMiddleware).Assembly, EmbeddedFileNamespace, pathPrefix, _options.CacheLifetime); } public async Task Invoke(HttpContext httpContext) @@ -77,23 +73,10 @@ public async Task Invoke(HttpContext httpContext) } } - await _staticFileMiddleware.Invoke(httpContext); - } - - private static StaticFileMiddleware CreateStaticFileMiddleware( - RequestDelegate next, - IWebHostEnvironment hostingEnv, - ILoggerFactory loggerFactory, - SwaggerUIOptions options) - { - var staticFileOptions = new StaticFileOptions + if (!await _compressedEmbeddedFileResponder.TryRespondWithFileAsync(httpContext)) { - RequestPath = string.IsNullOrEmpty(options.RoutePrefix) ? string.Empty : $"/{options.RoutePrefix}", - FileProvider = new EmbeddedFileProvider(typeof(SwaggerUIMiddleware).Assembly, EmbeddedFileNamespace), - OnPrepareResponse = (context) => SetCacheHeaders(context.Context.Response, options), - }; - - return new StaticFileMiddleware(next, hostingEnv, Options.Create(staticFileOptions), loggerFactory); + await _next(httpContext); + } } private static string GetSwaggerUIVersion() diff --git a/src/Swashbuckle.AspNetCore.SwaggerUI/Swashbuckle.AspNetCore.SwaggerUI.csproj b/src/Swashbuckle.AspNetCore.SwaggerUI/Swashbuckle.AspNetCore.SwaggerUI.csproj index 0e48416301..f5e8f3045c 100644 --- a/src/Swashbuckle.AspNetCore.SwaggerUI/Swashbuckle.AspNetCore.SwaggerUI.csproj +++ b/src/Swashbuckle.AspNetCore.SwaggerUI/Swashbuckle.AspNetCore.SwaggerUI.csproj @@ -14,7 +14,6 @@ - @@ -35,6 +34,10 @@ + + + + @@ -67,4 +70,27 @@ + + + <_SdkTasksTFM Condition=" '$(MSBuildRuntimeType)' == 'Core'">net9.0 + <_SdkTasksTFM Condition=" '$(MSBuildRuntimeType)' != 'Core'">net472 + + + + + + + + + + + + + + + + + + diff --git a/test/Swashbuckle.AspNetCore.IntegrationTests/ReDocIntegrationTests.cs b/test/Swashbuckle.AspNetCore.IntegrationTests/ReDocIntegrationTests.cs index e5a5b2cb13..9ec838910a 100644 --- a/test/Swashbuckle.AspNetCore.IntegrationTests/ReDocIntegrationTests.cs +++ b/test/Swashbuckle.AspNetCore.IntegrationTests/ReDocIntegrationTests.cs @@ -1,4 +1,6 @@ -using System.Net; +using System.IO.Compression; +using System.Net; +using System.Security.Cryptography; using Microsoft.AspNetCore.Builder; using Swashbuckle.AspNetCore.ReDoc; using ReDocApp = ReDoc; @@ -32,13 +34,13 @@ public async Task IndexUrl_ReturnsEmbeddedVersionOfTheRedocUI() AssertResource(htmlResponse); AssertResource(cssResponse); - AssertResource(jsResponse); + AssertResource(jsResponse, weakETag: false); - static void AssertResource(HttpResponseMessage response) + static void AssertResource(HttpResponseMessage response, bool weakETag = true) { Assert.Equal(HttpStatusCode.OK, response.StatusCode); Assert.NotNull(response.Headers.ETag); - Assert.True(response.Headers.ETag.IsWeak); + Assert.Equal(weakETag, response.Headers.ETag.IsWeak); Assert.NotEmpty(response.Headers.ETag.Tag); Assert.NotNull(response.Headers.CacheControl); Assert.True(response.Headers.CacheControl.Private); @@ -162,4 +164,41 @@ public void ReDocOptions_Extensions() Assert.True(options.ConfigObject.SortPropsAlphabetically); Assert.True(options.ConfigObject.UntrustedSpec); } + + [Fact] + public async Task ReDocMiddleware_Returns_ExpectedAssetContents() + { + var site = new TestSite(typeof(ReDocApp.Startup), outputHelper); + using var client = site.BuildClient(); + + using var htmlResponse = await client.GetAsync("/Api-Docs/redoc.standalone.js", TestContext.Current.CancellationToken); + Assert.Equal(HttpStatusCode.OK, htmlResponse.StatusCode); + + using var stream = await htmlResponse.Content.ReadAsStreamAsync(TestContext.Current.CancellationToken); + using var rawFileStream = typeof(ReDocIntegrationTests).Assembly.GetManifestResourceStream("Swashbuckle.AspNetCore.IntegrationTests.Embedded.ReDoc.redoc.standalone.js"); + + Assert.NotNull(rawFileStream); + Assert.Equal(SHA1.HashData(rawFileStream), SHA1.HashData(stream)); + } + + [Fact] + public async Task ReDocMiddleware_Returns_ExpectedAssetContents_GZipDirectly() + { + var site = new TestSite(typeof(ReDocApp.Startup), outputHelper); + using var client = site.BuildClient(); + + using var requestMessage = new HttpRequestMessage(HttpMethod.Get, "/Api-Docs/redoc.standalone.js"); + requestMessage.Headers.AcceptEncoding.Add(new("gzip")); + + using var htmlResponse = await client.SendAsync(requestMessage, TestContext.Current.CancellationToken); + Assert.Equal(HttpStatusCode.OK, htmlResponse.StatusCode); + Assert.Equal("gzip", htmlResponse.Content.Headers.ContentEncoding.Single()); + + using var stream = await htmlResponse.Content.ReadAsStreamAsync(TestContext.Current.CancellationToken); + using var gzipStream = new GZipStream(stream, CompressionMode.Decompress); + using var rawFileStream = typeof(ReDocIntegrationTests).Assembly.GetManifestResourceStream("Swashbuckle.AspNetCore.IntegrationTests.Embedded.ReDoc.redoc.standalone.js"); + + Assert.NotNull(rawFileStream); + Assert.Equal(SHA1.HashData(rawFileStream), SHA1.HashData(gzipStream)); + } } diff --git a/test/Swashbuckle.AspNetCore.IntegrationTests/SwaggerUIIntegrationTests.cs b/test/Swashbuckle.AspNetCore.IntegrationTests/SwaggerUIIntegrationTests.cs index b5c5443d3f..a849941e5a 100644 --- a/test/Swashbuckle.AspNetCore.IntegrationTests/SwaggerUIIntegrationTests.cs +++ b/test/Swashbuckle.AspNetCore.IntegrationTests/SwaggerUIIntegrationTests.cs @@ -1,4 +1,6 @@ -using System.Net; +using System.IO.Compression; +using System.Net; +using System.Security.Cryptography; namespace Swashbuckle.AspNetCore.IntegrationTests; @@ -40,19 +42,19 @@ public async Task IndexUrl_ReturnsEmbeddedVersionOfTheSwaggerUI( AssertResource(htmlResponse); using var jsResponse = await client.GetAsync(swaggerUijsPath, TestContext.Current.CancellationToken); - AssertResource(jsResponse); + AssertResource(jsResponse, weakETag: false); using var indexCss = await client.GetAsync(indexCssPath, TestContext.Current.CancellationToken); - AssertResource(indexCss); + AssertResource(indexCss, weakETag: false); using var cssResponse = await client.GetAsync(swaggerUiCssPath, TestContext.Current.CancellationToken); - AssertResource(cssResponse); + AssertResource(cssResponse, weakETag: false); - static void AssertResource(HttpResponseMessage response) + static void AssertResource(HttpResponseMessage response, bool weakETag = true) { Assert.Equal(HttpStatusCode.OK, response.StatusCode); Assert.NotNull(response.Headers.ETag); - Assert.True(response.Headers.ETag.IsWeak); + Assert.Equal(weakETag, response.Headers.ETag.IsWeak); Assert.NotEmpty(response.Headers.ETag.Tag); Assert.NotNull(response.Headers.CacheControl); Assert.True(response.Headers.CacheControl.Private); @@ -190,4 +192,91 @@ public async Task IndexUrl_Returns_ExpectedAssetPaths( Assert.Contains($" - From 6f77d1e7fe1509b931cc78f1d9b7b10f5699f252 Mon Sep 17 00:00:00 2001 From: Martin Costello Date: Wed, 10 Sep 2025 16:24:32 +0100 Subject: [PATCH 75/84] .NET 10 preparation (#3565) - Remove usage of `IWebHost` in tests. - Style tweaks and use of newer C# features. - Update NuGet packages to their latest versions. - Assert OpenAPI documents have no warnings. --- Directory.Packages.props | 8 +-- src/Swashbuckle.AspNetCore.Cli/Program.cs | 2 + .../AnnotationsDocumentFilterTests.cs | 10 ++-- .../AnnotationsParameterFilterTests.cs | 5 +- .../AnnotationsRequestBodyFilterTests.cs | 2 +- .../ApiTestRunnerBaseTests.cs | 6 +-- .../JsonValidatorTests.cs | 8 +-- .../RequestValidatorTests.cs | 2 +- .../ResponseValidatorTests.cs | 4 +- .../CustomDocumentSerializerTests.cs | 4 +- .../DocumentProviderTests.cs | 7 +-- .../SwaggerIntegrationTests.cs | 3 +- ...hbuckle.AspNetCore.IntegrationTests.csproj | 8 +-- .../TestSite.cs | 49 ++++++++++++++----- .../TestSiteAutofaq.cs | 37 ++++---------- .../VerifyTests.cs | 2 +- .../MvcWithNullable/MvcWithNullable.csproj | 2 +- .../OAuth2Integration.csproj | 4 +- test/WebSites/ReDoc/Startup.cs | 1 + .../WebApi/EndPoints/OpenApiEndpoints.cs | 1 + test/WebSites/WebApi/WebApi.csproj | 2 +- 21 files changed, 87 insertions(+), 80 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 431e84c03d..29848393ea 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -8,12 +8,12 @@ - - + + - - + + diff --git a/src/Swashbuckle.AspNetCore.Cli/Program.cs b/src/Swashbuckle.AspNetCore.Cli/Program.cs index da548a470f..ceea11ceeb 100644 --- a/src/Swashbuckle.AspNetCore.Cli/Program.cs +++ b/src/Swashbuckle.AspNetCore.Cli/Program.cs @@ -255,10 +255,12 @@ private static IServiceProvider GetServiceProvider(Assembly startupAssembly) return host.Services; } +#pragma warning disable ASPDEPR008 if (TryGetCustomHost(startupAssembly, "SwaggerWebHostFactory", "CreateWebHost", out IWebHost webHost)) { return webHost.Services; } +#pragma warning restore ASPDEPR008 try { diff --git a/test/Swashbuckle.AspNetCore.Annotations.Test/AnnotationsDocumentFilterTests.cs b/test/Swashbuckle.AspNetCore.Annotations.Test/AnnotationsDocumentFilterTests.cs index 9349fe26eb..41369ca8cf 100644 --- a/test/Swashbuckle.AspNetCore.Annotations.Test/AnnotationsDocumentFilterTests.cs +++ b/test/Swashbuckle.AspNetCore.Annotations.Test/AnnotationsDocumentFilterTests.cs @@ -1,7 +1,7 @@ using Microsoft.OpenApi.Models; -using Xunit; using Swashbuckle.AspNetCore.SwaggerGen; using Swashbuckle.AspNetCore.TestSupport; +using Xunit; namespace Swashbuckle.AspNetCore.Annotations.Test; @@ -13,7 +13,7 @@ public void Apply_CreatesMetadataForControllerNameTag_FromSwaggerTagAttribute() var document = new OpenApiDocument(); var apiDescription = ApiDescriptionFactory.Create(c => nameof(c.ActionWithNoAttributes)); var filterContext = new DocumentFilterContext( - apiDescriptions: new[] { apiDescription }, + apiDescriptions: [apiDescription], schemaGenerator: null, schemaRepository: null); @@ -24,8 +24,6 @@ public void Apply_CreatesMetadataForControllerNameTag_FromSwaggerTagAttribute() Assert.Equal("http://tempuri.org/", tag.ExternalDocs.Url.ToString()); } - private AnnotationsDocumentFilter Subject() - { - return new AnnotationsDocumentFilter(); - } + private static AnnotationsDocumentFilter Subject() + => new(); } diff --git a/test/Swashbuckle.AspNetCore.Annotations.Test/AnnotationsParameterFilterTests.cs b/test/Swashbuckle.AspNetCore.Annotations.Test/AnnotationsParameterFilterTests.cs index 48af7a7665..6fa6a8ae4f 100644 --- a/test/Swashbuckle.AspNetCore.Annotations.Test/AnnotationsParameterFilterTests.cs +++ b/test/Swashbuckle.AspNetCore.Annotations.Test/AnnotationsParameterFilterTests.cs @@ -61,8 +61,5 @@ public void Apply_DoesNotModifyTheRequiredFlag_IfNotSpecifiedWithSwaggerParamete Assert.True(parameter.Required); } - private AnnotationsParameterFilter Subject() - { - return new AnnotationsParameterFilter(); - } + private static AnnotationsParameterFilter Subject() => new(); } diff --git a/test/Swashbuckle.AspNetCore.Annotations.Test/AnnotationsRequestBodyFilterTests.cs b/test/Swashbuckle.AspNetCore.Annotations.Test/AnnotationsRequestBodyFilterTests.cs index fc2a93f672..374f380391 100644 --- a/test/Swashbuckle.AspNetCore.Annotations.Test/AnnotationsRequestBodyFilterTests.cs +++ b/test/Swashbuckle.AspNetCore.Annotations.Test/AnnotationsRequestBodyFilterTests.cs @@ -61,7 +61,7 @@ public void Apply_EnrichesParameterMetadata_IfPropertyDecoratedWithSwaggerReques var context = new RequestBodyFilterContext(bodyParameterDescription, null, null, null); Subject().Apply(requestBody, context); - + Assert.Equal("Description for StringWithSwaggerRequestBodyAttribute", requestBody.Description); Assert.True(requestBody.Required); } diff --git a/test/Swashbuckle.AspNetCore.ApiTesting.Test/ApiTestRunnerBaseTests.cs b/test/Swashbuckle.AspNetCore.ApiTesting.Test/ApiTestRunnerBaseTests.cs index e85c83e622..85c3a812d5 100644 --- a/test/Swashbuckle.AspNetCore.ApiTesting.Test/ApiTestRunnerBaseTests.cs +++ b/test/Swashbuckle.AspNetCore.ApiTesting.Test/ApiTestRunnerBaseTests.cs @@ -26,7 +26,7 @@ public async Task TestAsync_ThrowsException_IfOperationNotFound() { c.OpenApiDocs.Add("v1", new OpenApiDocument()); }); - + var exception = await Assert.ThrowsAsync(() => subject.TestAsync( "v1", "GetProducts", @@ -70,7 +70,7 @@ public async Task TestAsync_ThrowsException_IfExpectedStatusCodeIs2xxAndRequestD ], Responses = new OpenApiResponses { - [ "200" ] = new OpenApiResponse() + [ "200" ] = new OpenApiResponse() } } } @@ -118,7 +118,7 @@ public async Task TestAsync_ThrowsException_IfResponseDoesNotMatchSpec( Responses = new OpenApiResponses { ["400"] = new OpenApiResponse(), - ["200"] = new OpenApiResponse() + ["200"] = new OpenApiResponse() } } } diff --git a/test/Swashbuckle.AspNetCore.ApiTesting.Test/JsonValidatorTests.cs b/test/Swashbuckle.AspNetCore.ApiTesting.Test/JsonValidatorTests.cs index 0154284568..2eed054370 100644 --- a/test/Swashbuckle.AspNetCore.ApiTesting.Test/JsonValidatorTests.cs +++ b/test/Swashbuckle.AspNetCore.ApiTesting.Test/JsonValidatorTests.cs @@ -418,7 +418,7 @@ public void Validate_ReturnsError_IfRequiredPropertyNotPresent( var openApiSchema = new OpenApiSchema { Type = JsonSchemaTypes.Object, - Required = new SortedSet(schemaRequired) + Required = new SortedSet(schemaRequired), }; var instance = JToken.Parse(instanceText); @@ -541,7 +541,7 @@ public void Validate_ReturnsError_IfInstanceDoesNotMatchAllSchemasSpecifiedByAll [ new OpenApiSchema { Type = JsonSchemaTypes.Object, Required = new SortedSet { "p1" } }, new OpenApiSchema { Type = JsonSchemaTypes.Object, Required = new SortedSet { "p2" } }, - new OpenApiSchema { Type = JsonSchemaTypes.Object, Required = new SortedSet { "p3" } } + new OpenApiSchema { Type = JsonSchemaTypes.Object, Required = new SortedSet { "p3" } }, ] }; var instance = JToken.Parse(instanceText); @@ -570,7 +570,7 @@ public void Validate_ReturnsError_IfInstanceDoesNotMatchAnySchemaSpecifiedByAnyO [ new OpenApiSchema { Type = JsonSchemaTypes.Object, Required = new SortedSet { "p1" } }, new OpenApiSchema { Type = JsonSchemaTypes.Object, Required = new SortedSet { "p2" } }, - new OpenApiSchema { Type = JsonSchemaTypes.Object, Required = new SortedSet { "p3" } } + new OpenApiSchema { Type = JsonSchemaTypes.Object, Required = new SortedSet { "p3" } }, ] }; var instance = JToken.Parse(instanceText); @@ -600,7 +600,7 @@ public void Validate_ReturnsError_IfInstanceDoesNotMatchExactlyOneSchemaSpecifie [ new OpenApiSchema { Type = JsonSchemaTypes.Object, Required = new SortedSet { "p1" } }, new OpenApiSchema { Type = JsonSchemaTypes.Object, Required = new SortedSet { "p2" } }, - new OpenApiSchema { Type = JsonSchemaTypes.Object, Required = new SortedSet { "p3" } } + new OpenApiSchema { Type = JsonSchemaTypes.Object, Required = new SortedSet { "p3" } }, ] }; var instance = JToken.Parse(instanceText); diff --git a/test/Swashbuckle.AspNetCore.ApiTesting.Test/RequestValidatorTests.cs b/test/Swashbuckle.AspNetCore.ApiTesting.Test/RequestValidatorTests.cs index 38090f27ff..dc0bc1d1ae 100644 --- a/test/Swashbuckle.AspNetCore.ApiTesting.Test/RequestValidatorTests.cs +++ b/test/Swashbuckle.AspNetCore.ApiTesting.Test/RequestValidatorTests.cs @@ -392,6 +392,6 @@ private static OpenApiDocument DocumentWithOperation(string pathTemplate, Operat private static RequestValidator Subject(IEnumerable contentValidators = null) { - return new RequestValidator(contentValidators ?? []); + return new(contentValidators ?? []); } } diff --git a/test/Swashbuckle.AspNetCore.ApiTesting.Test/ResponseValidatorTests.cs b/test/Swashbuckle.AspNetCore.ApiTesting.Test/ResponseValidatorTests.cs index e6cb61db64..bb5eafe01e 100644 --- a/test/Swashbuckle.AspNetCore.ApiTesting.Test/ResponseValidatorTests.cs +++ b/test/Swashbuckle.AspNetCore.ApiTesting.Test/ResponseValidatorTests.cs @@ -215,7 +215,7 @@ public void Validate_DelegatesContentValidationToInjectedContentValidators( Schema = new OpenApiSchema { Type = JsonSchemaTypes.Object, - Required = new SortedSet { "prop1", "prop2" } + Required = new SortedSet { "prop1", "prop2" }, } } } @@ -259,6 +259,6 @@ private static OpenApiDocument DocumentWithOperation(string pathTemplate, Operat private static ResponseValidator Subject(IEnumerable contentValidators = null) { - return new ResponseValidator(contentValidators ?? []); + return new(contentValidators ?? []); } } diff --git a/test/Swashbuckle.AspNetCore.IntegrationTests/CustomDocumentSerializerTests.cs b/test/Swashbuckle.AspNetCore.IntegrationTests/CustomDocumentSerializerTests.cs index 19dc653086..cdf8f9c6b4 100644 --- a/test/Swashbuckle.AspNetCore.IntegrationTests/CustomDocumentSerializerTests.cs +++ b/test/Swashbuckle.AspNetCore.IntegrationTests/CustomDocumentSerializerTests.cs @@ -49,7 +49,7 @@ public async Task DocumentProvider_Writes_Custom_V3_Document() { var testSite = new TestSite(typeof(CustomDocumentSerializer.Startup), outputHelper); var server = testSite.BuildServer(); - var services = server.Host.Services; + var services = server.Services; var documentProvider = services.GetService(); using var stream = new MemoryStream(); @@ -80,7 +80,7 @@ private async Task DocumentProviderWritesCustomV2Document(Action { var testSite = new TestSite(typeof(CustomDocumentSerializer.Startup), outputHelper); var server = testSite.BuildServer(); - var services = server.Host.Services; + var services = server.Services; var documentProvider = services.GetService(); var options = services.GetService>(); diff --git a/test/Swashbuckle.AspNetCore.IntegrationTests/DocumentProviderTests.cs b/test/Swashbuckle.AspNetCore.IntegrationTests/DocumentProviderTests.cs index 8bf64cf30b..60c8f31701 100644 --- a/test/Swashbuckle.AspNetCore.IntegrationTests/DocumentProviderTests.cs +++ b/test/Swashbuckle.AspNetCore.IntegrationTests/DocumentProviderTests.cs @@ -18,7 +18,7 @@ public void DocumentProvider_ExposesAllDocumentNames(Type startupType, string[] { var testSite = new TestSite(startupType, outputHelper); var server = testSite.BuildServer(); - var services = server.Host.Services; + var services = server.Services; var documentProvider = (IDocumentProvider)services.GetService(typeof(IDocumentProvider)); var documentNames = documentProvider.GetDocumentNames(); @@ -37,7 +37,7 @@ public async Task DocumentProvider_ExposesGeneratedSwagger(Type startupType, str { var testSite = new TestSite(startupType, outputHelper); var server = testSite.BuildServer(); - var services = server.Host.Services; + var services = server.Services; var documentProvider = (IDocumentProvider)services.GetService(typeof(IDocumentProvider)); using var stream = new MemoryStream(); @@ -51,6 +51,7 @@ public async Task DocumentProvider_ExposesGeneratedSwagger(Type startupType, str var (_, diagnostic) = await OpenApiDocumentLoader.LoadWithDiagnosticsAsync(stream); Assert.NotNull(diagnostic); Assert.Empty(diagnostic.Errors); + Assert.Empty(diagnostic.Warnings); } [Fact] @@ -58,7 +59,7 @@ public async Task DocumentProvider_ThrowsUnknownDocument_IfUnknownDocumentName() { var testSite = new TestSite(typeof(Basic.Startup), outputHelper); var server = testSite.BuildServer(); - var services = server.Host.Services; + var services = server.Services; var documentProvider = (IDocumentProvider)services.GetService(typeof(IDocumentProvider)); using var writer = new StringWriter(); diff --git a/test/Swashbuckle.AspNetCore.IntegrationTests/SwaggerIntegrationTests.cs b/test/Swashbuckle.AspNetCore.IntegrationTests/SwaggerIntegrationTests.cs index 98a8c8bca2..55ee5c5f94 100644 --- a/test/Swashbuckle.AspNetCore.IntegrationTests/SwaggerIntegrationTests.cs +++ b/test/Swashbuckle.AspNetCore.IntegrationTests/SwaggerIntegrationTests.cs @@ -36,7 +36,7 @@ public async Task SwaggerEndpoint_ReturnsValidSwaggerJson( [Fact] public async Task SwaggerEndpoint_ReturnsValidSwaggerJson_ForAutofaq() { - var testSite = new TestSiteAutofaq(typeof(CliExampleWithFactory.Startup)); + var testSite = new TestSiteAutofaq(typeof(CliExampleWithFactory.Startup), outputHelper); using var client = testSite.BuildClient(); await AssertValidSwaggerJson(client, "/swagger/v1/swagger_net8.0.json"); @@ -205,5 +205,6 @@ private static async Task AssertValidSwaggerJson(HttpClient client, string swagg var (_, diagnostic) = await OpenApiDocumentLoader.LoadWithDiagnosticsAsync(contentStream); Assert.NotNull(diagnostic); Assert.Empty(diagnostic.Errors); + Assert.Empty(diagnostic.Warnings); } } diff --git a/test/Swashbuckle.AspNetCore.IntegrationTests/Swashbuckle.AspNetCore.IntegrationTests.csproj b/test/Swashbuckle.AspNetCore.IntegrationTests/Swashbuckle.AspNetCore.IntegrationTests.csproj index 050373b86a..3d3a84a83e 100644 --- a/test/Swashbuckle.AspNetCore.IntegrationTests/Swashbuckle.AspNetCore.IntegrationTests.csproj +++ b/test/Swashbuckle.AspNetCore.IntegrationTests/Swashbuckle.AspNetCore.IntegrationTests.csproj @@ -30,13 +30,13 @@ - - + + - - + + diff --git a/test/Swashbuckle.AspNetCore.IntegrationTests/TestSite.cs b/test/Swashbuckle.AspNetCore.IntegrationTests/TestSite.cs index b6fdbab42c..9af7057754 100644 --- a/test/Swashbuckle.AspNetCore.IntegrationTests/TestSite.cs +++ b/test/Swashbuckle.AspNetCore.IntegrationTests/TestSite.cs @@ -4,29 +4,33 @@ using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.TestHost; using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Logging; namespace Swashbuckle.AspNetCore.IntegrationTests; public class TestSite(Type startupType, ITestOutputHelper outputHelper) { - public TestServer BuildServer() + private IHost _host; + private TestServer _server; + + public virtual TestServer BuildServer() { - var startupAssembly = startupType.Assembly; - var applicationName = startupAssembly.GetName().Name; + if (_server is null) + { + var builder = new HostBuilder(); - var builder = new WebHostBuilder() - .UseEnvironment("Development") - .UseSolutionRelativeContentRoot(Path.Combine("test", "WebSites", applicationName), "*.slnx") - .UseStartup(startupType); + Configure(builder); - builder.ConfigureTestServices((services) => - { - services.AddLogging((logging) => logging.ClearProviders().AddXUnit(outputHelper)); - services.AddTransient(); - }); + builder.ConfigureWebHost(Configure); + + _host = builder.Build(); + _host.Start(); - return new(builder); + _server = _host.GetTestServer(); + } + + return _server; } public HttpClient BuildClient() @@ -35,6 +39,25 @@ public HttpClient BuildClient() return server.CreateClient(); } + protected virtual void Configure(IHostBuilder builder) + { + builder.ConfigureServices((services) => + { + services.AddLogging((logging) => logging.ClearProviders().AddXUnit(outputHelper)); + services.AddTransient(); + }); + } + + protected virtual void Configure(IWebHostBuilder builder) + { + var applicationName = startupType.Assembly.GetName().Name; + + builder.UseEnvironment("Development") + .UseSolutionRelativeContentRoot(Path.Combine("test", "WebSites", applicationName), "*.slnx") + .UseStartup(startupType) + .UseTestServer(); + } + private sealed class LocalizationStartupFilter : IStartupFilter { public Action Configure(Action next) diff --git a/test/Swashbuckle.AspNetCore.IntegrationTests/TestSiteAutofaq.cs b/test/Swashbuckle.AspNetCore.IntegrationTests/TestSiteAutofaq.cs index 2ce4e835e7..43efd9d779 100644 --- a/test/Swashbuckle.AspNetCore.IntegrationTests/TestSiteAutofaq.cs +++ b/test/Swashbuckle.AspNetCore.IntegrationTests/TestSiteAutofaq.cs @@ -1,38 +1,21 @@ -using System.Reflection; -using Autofac.Extensions.DependencyInjection; +using Autofac.Extensions.DependencyInjection; using Microsoft.AspNetCore.Hosting; -using Microsoft.AspNetCore.TestHost; +using Microsoft.Extensions.Hosting; namespace Swashbuckle.AspNetCore.IntegrationTests; -public class TestSiteAutofaq +public class TestSiteAutofaq(Type startupType, ITestOutputHelper outputHelper) + : TestSite(startupType, outputHelper) { - private readonly Type _startupType; - - public TestSiteAutofaq(Type startupType) + protected override void Configure(IHostBuilder builder) { - _startupType = startupType; + base.Configure(builder); + builder.UseServiceProviderFactory(new AutofacServiceProviderFactory()); } - public TestServer BuildServer() + protected override void Configure(IWebHostBuilder builder) { - var startupAssembly = _startupType.Assembly; - var applicationName = startupAssembly.GetName().Name; - - var hostBuilder = new WebHostBuilder() - .UseEnvironment("Development") - .ConfigureServices(services => services.AddAutofac()) - .UseSolutionRelativeContentRoot(Path.Combine("test", "WebSites", applicationName), "*.slnx") - .UseStartup(_startupType); - - return new TestServer(hostBuilder); - } - - public HttpClient BuildClient() - { - var server = BuildServer(); - var client = server.CreateClient(); - - return client; + builder.ConfigureServices((services) => services.AddAutofac()); + base.Configure(builder); } } diff --git a/test/Swashbuckle.AspNetCore.IntegrationTests/VerifyTests.cs b/test/Swashbuckle.AspNetCore.IntegrationTests/VerifyTests.cs index 847824a73e..ffe2aec60d 100644 --- a/test/Swashbuckle.AspNetCore.IntegrationTests/VerifyTests.cs +++ b/test/Swashbuckle.AspNetCore.IntegrationTests/VerifyTests.cs @@ -42,7 +42,7 @@ public async Task SwaggerEndpoint_ReturnsValidSwaggerJson_ForAutofaq() var startupType = typeof(CliExampleWithFactory.Startup); const string swaggerRequestUri = "/swagger/v1/swagger_net8.0.json"; - var testSite = new TestSiteAutofaq(startupType); + var testSite = new TestSiteAutofaq(startupType, outputHelper); using var client = testSite.BuildClient(); using var swaggerResponse = await client.GetAsync(swaggerRequestUri, TestContext.Current.CancellationToken); diff --git a/test/WebSites/MvcWithNullable/MvcWithNullable.csproj b/test/WebSites/MvcWithNullable/MvcWithNullable.csproj index 1a95be247f..f4465a728b 100644 --- a/test/WebSites/MvcWithNullable/MvcWithNullable.csproj +++ b/test/WebSites/MvcWithNullable/MvcWithNullable.csproj @@ -18,7 +18,7 @@ - + diff --git a/test/WebSites/OAuth2Integration/OAuth2Integration.csproj b/test/WebSites/OAuth2Integration/OAuth2Integration.csproj index 56cc1d3b57..5bbc961286 100644 --- a/test/WebSites/OAuth2Integration/OAuth2Integration.csproj +++ b/test/WebSites/OAuth2Integration/OAuth2Integration.csproj @@ -11,12 +11,12 @@ - + - + diff --git a/test/WebSites/ReDoc/Startup.cs b/test/WebSites/ReDoc/Startup.cs index a41f56fe1d..e2a96e9732 100644 --- a/test/WebSites/ReDoc/Startup.cs +++ b/test/WebSites/ReDoc/Startup.cs @@ -28,6 +28,7 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env) app.UseEndpoints(endpoints => { endpoints.MapControllers(); + endpoints.MapGet("/", () => Results.Redirect("api-docs")); }); app.UseSwagger(c => diff --git a/test/WebSites/WebApi/EndPoints/OpenApiEndpoints.cs b/test/WebSites/WebApi/EndPoints/OpenApiEndpoints.cs index cd48ac6313..04d3a629d5 100644 --- a/test/WebSites/WebApi/EndPoints/OpenApiEndpoints.cs +++ b/test/WebSites/WebApi/EndPoints/OpenApiEndpoints.cs @@ -98,6 +98,7 @@ public static IEndpointRouteBuilder MapWithOpenApiEndpoints(this IEndpointRouteB return app; } } + record WeatherForecast(DateOnly Date, int TemperatureC, string? Summary) { public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); diff --git a/test/WebSites/WebApi/WebApi.csproj b/test/WebSites/WebApi/WebApi.csproj index 503306e6ff..c509238d96 100644 --- a/test/WebSites/WebApi/WebApi.csproj +++ b/test/WebSites/WebApi/WebApi.csproj @@ -19,7 +19,7 @@ - + From 9008b30810bf6c80b8c91d6ef7721839e25ae4bf Mon Sep 17 00:00:00 2001 From: Martin Costello Date: Mon, 15 Sep 2025 14:59:25 +0100 Subject: [PATCH 76/84] Update zizmor - Update zizmor to 1.13.0. - Add zizmor configuration file to disable noisy rules. --- .github/workflows/actions-lint.yml | 2 +- .github/zizmor.yml | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .github/zizmor.yml diff --git a/.github/workflows/actions-lint.yml b/.github/workflows/actions-lint.yml index 0b0cc16e25..80873bf148 100644 --- a/.github/workflows/actions-lint.yml +++ b/.github/workflows/actions-lint.yml @@ -16,7 +16,7 @@ permissions: {} env: FORCE_COLOR: 3 TERM: xterm - ZIZMOR_VERSION: '1.12.0' + ZIZMOR_VERSION: '1.13.0' jobs: lint: diff --git a/.github/zizmor.yml b/.github/zizmor.yml new file mode 100644 index 0000000000..ad6d776482 --- /dev/null +++ b/.github/zizmor.yml @@ -0,0 +1,5 @@ +rules: + anonymous-definition: + disable: true + undocumented-permissions: + disable: true From 1c2b15c104a545259cf500fc17a67a169ccb94bb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 17 Sep 2025 12:07:45 +0100 Subject: [PATCH 77/84] Bump zizmorcore/zizmor-action from 0.1.2 to 0.2.0 (#3570) --- .github/workflows/actions-lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/actions-lint.yml b/.github/workflows/actions-lint.yml index 80873bf148..5f42ab341d 100644 --- a/.github/workflows/actions-lint.yml +++ b/.github/workflows/actions-lint.yml @@ -45,7 +45,7 @@ jobs: args: -color - name: Lint workflows with zizmor - uses: zizmorcore/zizmor-action@5ca5fc7a4779c5263a3ffa0e1f693009994446d1 # v0.1.2 + uses: zizmorcore/zizmor-action@e673c3917a1aef3c65c972347ed84ccd013ecda4 # v0.2.0 with: persona: pedantic version: ${{ env.ZIZMOR_VERSION }} From 0bc9eb504a33c64a4469efb72cd7026285a4abf7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 17 Sep 2025 12:08:15 +0100 Subject: [PATCH 78/84] Bump the xunit group with 1 update (#3571) --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 29848393ea..ae399227f3 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -22,7 +22,7 @@ - + From 6ddd16c353e37a2b1280485120adac57d9f61446 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 17 Sep 2025 12:08:38 +0100 Subject: [PATCH 79/84] Bump anchore/sbom-action from 0.20.5 to 0.20.6 (#3569) --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f435840475..fc91e876e7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -114,7 +114,7 @@ jobs: token: ${{ secrets.CODECOV_TOKEN }} - name: Generate SBOM - uses: anchore/sbom-action@da167eac915b4e86f08b264dbdbc867b61be6f0c # v0.20.5 + uses: anchore/sbom-action@f8bdd1d8ac5e901a77a92f111440fdb1b593736b # v0.20.6 if: runner.os == 'Windows' with: artifact-name: Swashbuckle.AspNetCore.spdx.json From a0dbf30a373e08e540fbee92a38ce01d3f11e953 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 17 Sep 2025 11:15:17 +0000 Subject: [PATCH 80/84] Bump github/codeql-action from 3.30.2 to 3.30.3 (#3568) --- .github/workflows/codeql-analysis.yml | 4 ++-- .github/workflows/ossf-scorecard.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 39dc434cba..89a15dd0bd 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -30,12 +30,12 @@ jobs: show-progress: false - name: Initialize CodeQL - uses: github/codeql-action/init@d3678e237b9c32a6c9bffb3315c335f976f3549f # v3.30.2 + uses: github/codeql-action/init@192325c86100d080feab897ff886c34abd4c83a3 # v3.30.3 with: languages: csharp build-mode: none - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@d3678e237b9c32a6c9bffb3315c335f976f3549f # v3.30.2 + uses: github/codeql-action/analyze@192325c86100d080feab897ff886c34abd4c83a3 # v3.30.3 with: category: '/language:csharp' diff --git a/.github/workflows/ossf-scorecard.yml b/.github/workflows/ossf-scorecard.yml index c23a2ef829..85fd0869d3 100644 --- a/.github/workflows/ossf-scorecard.yml +++ b/.github/workflows/ossf-scorecard.yml @@ -41,6 +41,6 @@ jobs: retention-days: 5 - name: Upload to code-scanning - uses: github/codeql-action/upload-sarif@d3678e237b9c32a6c9bffb3315c335f976f3549f # v3.30.2 + uses: github/codeql-action/upload-sarif@192325c86100d080feab897ff886c34abd4c83a3 # v3.30.3 with: sarif_file: results.sarif From a097d5d63acf4c48893d87072f01a6f07ef9c69c Mon Sep 17 00:00:00 2001 From: martincostello Date: Fri, 19 Sep 2025 08:37:09 +0100 Subject: [PATCH 81/84] Update NuGet packages Update various NuGet dependencies to their latest versions. --- Directory.Packages.props | 10 +++++----- .../OAuth2Integration/OAuth2Integration.csproj | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index ae399227f3..05d323108b 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -1,7 +1,7 @@  - + @@ -18,11 +18,11 @@ - + - - - + + + diff --git a/test/WebSites/OAuth2Integration/OAuth2Integration.csproj b/test/WebSites/OAuth2Integration/OAuth2Integration.csproj index 5bbc961286..52db6fe4a1 100644 --- a/test/WebSites/OAuth2Integration/OAuth2Integration.csproj +++ b/test/WebSites/OAuth2Integration/OAuth2Integration.csproj @@ -12,12 +12,12 @@ - + - + From 2fde3e9cdd66745c5ae7135eff24d68afa184de6 Mon Sep 17 00:00:00 2001 From: Martin Costello Date: Tue, 23 Sep 2025 13:30:05 +0100 Subject: [PATCH 82/84] Fix anchors Fix two broken documentation anchors --- README.md | 96 +++++++++++++++++++++++++++---------------------------- 1 file changed, 48 insertions(+), 48 deletions(-) diff --git a/README.md b/README.md index e11f115a57..7a4392e6ed 100644 --- a/README.md +++ b/README.md @@ -221,54 +221,54 @@ Check out the table below for the full list of possible configuration options. | **Component** | **Configuration and Customization** | | ------------- | ----------------------------------- | -| **Swashbuckle.AspNetCore.Swagger** | [Change the Path for Swagger JSON Endpoints](docs/configure-and-customize-swagger.md#change-the-path-for-swagger-json-endpoints) | -| | [Modify Swagger with Request Context](docs/configure-and-customize-swagger.md#modify-swagger-with-request-context) | -| | [Serialize Swagger JSON in the 2.0 format](docs/configure-and-customize-swagger.md#serialize-swagger-in-the-20-format) | -| | [Working with Virtual Directories and Reverse Proxies](docs/configure-and-customize-swagger.md#working-with-virtual-directories-and-reverse-proxies) | -| | [Customizing how the OpenAPI document is serialized](docs/configure-and-customize-swagger.md#customizing-how-the-openapi-document-is-serialized) | -| **Swashbuckle.AspNetCore.SwaggerGen** | [Assign Explicit OperationIds](docs/configure-and-customize-swaggergen.md#assign-explicit-operationids) | -| | [List Operations Responses](docs/configure-and-customize-swaggergen.md#list-operation-responses) | -| | [Flag Required Parameters and Schema Properties](docs/configure-and-customize-swaggergen.md#flag-required-parameters-and-schema-properties) | -| | [Handle Forms and File Uploads](docs/configure-and-customize-swaggergen.md#handle-forms-and-file-uploads) | -| | [Handle File Downloads](docs/configure-and-customize-swaggergen.md#handle-file-downloads) | -| | [Include Descriptions from XML Comments](docs/configure-and-customize-swaggergen.md#include-descriptions-from-xml-comments) | -| | [Provide Global API Metadata](docs/configure-and-customize-swaggergen.md#provide-global-api-metadata) | -| | [Generate Multiple Swagger Documents](docs/configure-and-customize-swaggergen.md#generate-multiple-swagger-documents) | -| | [Omit Obsolete Operations and/or Schema Properties](docs/configure-and-customize-swaggergen.md#omit-obsolete-operations-andor-schema-properties) | -| | [Omit Arbitrary Operations](docs/configure-and-customize-swaggergen.md#omit-arbitrary-operations) | -| | [Customize Operation Tags (e.g. for UI Grouping)](docs/configure-and-customize-swaggergen.md#customize-operation-tags-eg-for-ui-grouping) | -| | [Change Operation Sort Order (e.g. for UI Sorting)](docs/configure-and-customize-swaggergen.md#change-operation-sort-order-eg-for-ui-sorting) | -| | [Customize Schema Ids](docs/configure-and-customize-swaggergen.md#customize-schema-ids) | -| | [Override Schema for Specific Types](docs/configure-and-customize-swaggergen.md#override-schema-for-specific-types) | -| | [Extend Generator with Operation, Schema & Document Filters](docs/configure-and-customize-swaggergen.md#extend-generator-with-operation-schema--document-filters) | -| | [Add Security Definitions and Requirements](docs/configure-and-customize-swaggergen.md#add-security-definitions-and-requirements) | -| | [Add Security Definitions and Requirements for Bearer auth](docs/configure-and-customize-swaggergen.md#add-security-definitions-and-requirements-for-bearer-auth) | -| | [Inheritance and Polymorphism](docs/configure-and-customize-swaggergen.md#inheritance-and-polymorphism) | -| **Swashbuckle.AspNetCore.SwaggerUI** | [Change Relative Path to the UI](docs/configure-and-customize-swaggerui.md#change-relative-path-to-the-ui) | -| | [Change Document Title](docs/configure-and-customize-swaggerui.md#change-document-title) | -| | [Change CSS or JS Paths](docs/configure-and-customize-swaggerui.md#change-css-or-js-paths) | -| | [List Multiple Swagger Documents](docs/configure-and-customize-swaggerui.md#list-multiple-swagger-documents) | -| | [Apply swagger-ui Parameters](docs/configure-and-customize-swaggerui.md#apply-swagger-ui-parameters) | -| | [Inject Custom JavaScript](docs/configure-and-customize-swaggerui.md#inject-custom-javascript) | -| | [Inject Custom CSS](docs/configure-and-customize-swaggerui.md#inject-custom-css) | -| | [Customize index.html](docs/configure-and-customize-swaggerui.md#customize-indexhtml) | -| | [Enable OAuth2.0 Flows](docs/configure-and-customize-swaggerui.md#enable-oauth20-flows) | -| | [Use client-side request and response interceptors](docs/configure-and-customize-swaggerui.md#use-client-side-request-and-response-interceptors) | -| **Swashbuckle.AspNetCore.Annotations** | [Install and Enable Annotations](docs/configure-and-customize-annotations.md#install-and-enable-annotations) | -| | [Enrich Operation Metadata](docs/configure-and-customize-annotations.md#enrich-operation-metadata) | -| | [Enrich Response Metadata](docs/configure-and-customize-annotations.md#enrich-response-metadata) | -| | [Enrich Parameter Metadata](docs/configure-and-customize-annotations.md#enrich-parameter-metadata) | -| | [Enrich RequestBody Metadata](docs/configure-and-customize-annotations.md#enrich-requestbody-metadata) | -| | [Enrich Schema Metadata](docs/configure-and-customize-annotations.md#enrich-schema-metadata) | -| | [Apply Schema Filters to Specific Types](docs/configure-and-customize-annotations.md#apply-schema-filters-to-specific-types) | -| | [Add Tag Metadata](docs/configure-and-customize-annotations.md#add-tag-metadata) | -| **Swashbuckle.AspNetCore.Cli** | [Retrieve Swagger Directly from a Startup Assembly](docs/configure-and-customize-cli.md#retrieve-swagger-directly-from-a-startup-assembly) | -| | [Use the CLI Tool with a Custom Host Configuration](docs/configure-and-customize-cli.md#use-the-cli-tool-with-a-custom-host-configuration) | -| **Swashbuckle.AspNetCore.ReDoc** | [Change Relative Path to the UI](docs/configure-and-customize-redoc.md#change-relative-path-to-the-ui) | -| | [Change Document Title](docs/configure-and-customize-redoc.md#change-document-title) | -| | [Apply Redoc Parameters](docs/configure-and-customize-redoc.md#apply-redoc-parameters) | -| | [Inject Custom CSS](docs/configure-and-customize-redoc.md#inject-custom-css) | -| | [Customize index.html](docs/configure-and-customize-redoc.md#customize-indexhtml) | +| **Swashbuckle.AspNetCore.Swagger** | [Change the Path for Swagger JSON Endpoints](docs/configure-and-customize-swagger.md#change-the-path-for-swagger-json-endpoints) | +| | [Modify Swagger with Request Context](docs/configure-and-customize-swagger.md#modify-swagger-with-request-context) | +| | [Serialize Swagger JSON in the 2.0 format](docs/configure-and-customize-swagger.md#serialize-swagger-in-the-20-format) | +| | [Working with Virtual Directories and Reverse Proxies](docs/configure-and-customize-swagger.md#working-with-virtual-directories-and-reverse-proxies) | +| | [Customizing how the OpenAPI document is serialized](docs/configure-and-customize-swagger.md#customizing-how-the-openapi-document-is-serialized) | +| **Swashbuckle.AspNetCore.SwaggerGen** | [Assign Explicit OperationIds](docs/configure-and-customize-swaggergen.md#assign-explicit-operationids) | +| | [List Operations Responses](docs/configure-and-customize-swaggergen.md#list-operation-responses) | +| | [Flag Required Parameters and Schema Properties](docs/configure-and-customize-swaggergen.md#flag-required-parameters-and-schema-properties) | +| | [Handle Forms and File Uploads](docs/configure-and-customize-swaggergen.md#handle-forms-and-file-uploads) | +| | [Handle File Downloads](docs/configure-and-customize-swaggergen.md#handle-file-downloads) | +| | [Include Descriptions from XML Comments](docs/configure-and-customize-swaggergen.md#include-descriptions-from-xml-comments) | +| | [Provide Global API Metadata](docs/configure-and-customize-swaggergen.md#provide-global-api-metadata) | +| | [Generate Multiple Swagger Documents](docs/configure-and-customize-swaggergen.md#generate-multiple-swagger-documents) | +| | [Omit Obsolete Operations and/or Schema Properties](docs/configure-and-customize-swaggergen.md#omit-obsolete-operations-andor-schema-properties) | +| | [Omit Arbitrary Operations](docs/configure-and-customize-swaggergen.md#omit-arbitrary-operations) | +| | [Customize Operation Tags (e.g. for UI Grouping)](docs/configure-and-customize-swaggergen.md#customize-operation-tags-eg-for-ui-grouping) | +| | [Change Operation Sort Order (e.g. for UI Sorting)](docs/configure-and-customize-swaggergen.md#change-operation-sort-order-eg-for-ui-sorting) | +| | [Customize Schema Ids](docs/configure-and-customize-swaggergen.md#customize-schema-ids) | +| | [Override Schema for Specific Types](docs/configure-and-customize-swaggergen.md#override-schema-for-specific-types) | +| | [Extend Generator with Operation, Schema & Document Filters](docs/configure-and-customize-swaggergen.md#extend-generator-with-operation-schema-and-document-filters) | +| | [Add Security Definitions and Requirements](docs/configure-and-customize-swaggergen.md#add-security-definitions-and-requirements) | +| | [Add Security Definitions and Requirements for Bearer auth](docs/configure-and-customize-swaggergen.md#add-security-definitions-and-requirements-for-bearer-authentication) | +| | [Inheritance and Polymorphism](docs/configure-and-customize-swaggergen.md#inheritance-and-polymorphism) | +| **Swashbuckle.AspNetCore.SwaggerUI** | [Change Relative Path to the UI](docs/configure-and-customize-swaggerui.md#change-relative-path-to-the-ui) | +| | [Change Document Title](docs/configure-and-customize-swaggerui.md#change-document-title) | +| | [Change CSS or JS Paths](docs/configure-and-customize-swaggerui.md#change-css-or-js-paths) | +| | [List Multiple Swagger Documents](docs/configure-and-customize-swaggerui.md#list-multiple-swagger-documents) | +| | [Apply swagger-ui Parameters](docs/configure-and-customize-swaggerui.md#apply-swagger-ui-parameters) | +| | [Inject Custom JavaScript](docs/configure-and-customize-swaggerui.md#inject-custom-javascript) | +| | [Inject Custom CSS](docs/configure-and-customize-swaggerui.md#inject-custom-css) | +| | [Customize index.html](docs/configure-and-customize-swaggerui.md#customize-indexhtml) | +| | [Enable OAuth2.0 Flows](docs/configure-and-customize-swaggerui.md#enable-oauth20-flows) | +| | [Use client-side request and response interceptors](docs/configure-and-customize-swaggerui.md#use-client-side-request-and-response-interceptors) | +| **Swashbuckle.AspNetCore.Annotations** | [Install and Enable Annotations](docs/configure-and-customize-annotations.md#install-and-enable-annotations) | +| | [Enrich Operation Metadata](docs/configure-and-customize-annotations.md#enrich-operation-metadata) | +| | [Enrich Response Metadata](docs/configure-and-customize-annotations.md#enrich-response-metadata) | +| | [Enrich Parameter Metadata](docs/configure-and-customize-annotations.md#enrich-parameter-metadata) | +| | [Enrich RequestBody Metadata](docs/configure-and-customize-annotations.md#enrich-requestbody-metadata) | +| | [Enrich Schema Metadata](docs/configure-and-customize-annotations.md#enrich-schema-metadata) | +| | [Apply Schema Filters to Specific Types](docs/configure-and-customize-annotations.md#apply-schema-filters-to-specific-types) | +| | [Add Tag Metadata](docs/configure-and-customize-annotations.md#add-tag-metadata) | +| **Swashbuckle.AspNetCore.Cli** | [Retrieve Swagger Directly from a Startup Assembly](docs/configure-and-customize-cli.md#retrieve-swagger-directly-from-a-startup-assembly) | +| | [Use the CLI Tool with a Custom Host Configuration](docs/configure-and-customize-cli.md#use-the-cli-tool-with-a-custom-host-configuration) | +| **Swashbuckle.AspNetCore.ReDoc** | [Change Relative Path to the UI](docs/configure-and-customize-redoc.md#change-relative-path-to-the-ui) | +| | [Change Document Title](docs/configure-and-customize-redoc.md#change-document-title) | +| | [Apply Redoc Parameters](docs/configure-and-customize-redoc.md#apply-redoc-parameters) | +| | [Inject Custom CSS](docs/configure-and-customize-redoc.md#inject-custom-css) | +| | [Customize index.html](docs/configure-and-customize-redoc.md#customize-indexhtml) | From 4b481a179f2412a24062ae9330535885f373520f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 24 Sep 2025 09:21:42 +0000 Subject: [PATCH 83/84] Bump the xunit group with 1 update (#3578) Bumps Verify.XunitV3 from 30.16.0 to 30.18.0 --- updated-dependencies: - dependency-name: Verify.XunitV3 dependency-version: 30.18.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: xunit ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 05d323108b..6bbca4604c 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -22,7 +22,7 @@ - + From ff236ab2cc2294bd282656e6812fca4b42c1a5e3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 Sep 2025 09:17:45 +0100 Subject: [PATCH 84/84] Bump swagger-ui-dist in /src/Swashbuckle.AspNetCore.SwaggerUI (#3580) --- src/Swashbuckle.AspNetCore.SwaggerUI/package-lock.json | 8 ++++---- src/Swashbuckle.AspNetCore.SwaggerUI/package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Swashbuckle.AspNetCore.SwaggerUI/package-lock.json b/src/Swashbuckle.AspNetCore.SwaggerUI/package-lock.json index 5490ac213a..11a2a7219d 100644 --- a/src/Swashbuckle.AspNetCore.SwaggerUI/package-lock.json +++ b/src/Swashbuckle.AspNetCore.SwaggerUI/package-lock.json @@ -9,7 +9,7 @@ "version": "1.0.0", "hasInstallScript": true, "dependencies": { - "swagger-ui-dist": "5.29.0" + "swagger-ui-dist": "5.29.1" } }, "node_modules/@scarf/scarf": { @@ -20,9 +20,9 @@ "license": "Apache-2.0" }, "node_modules/swagger-ui-dist": { - "version": "5.29.0", - "resolved": "https://registry.npmjs.org/swagger-ui-dist/-/swagger-ui-dist-5.29.0.tgz", - "integrity": "sha512-gqs7Md3AxP4mbpXAq31o5QW+wGUZsUzVatg70yXpUR245dfIis5jAzufBd+UQM/w2xSfrhvA1eqsrgnl2PbezQ==", + "version": "5.29.1", + "resolved": "https://registry.npmjs.org/swagger-ui-dist/-/swagger-ui-dist-5.29.1.tgz", + "integrity": "sha512-qyjpz0qgcomRr41a5Aye42o69TKwCeHM9F8htLGVeUMKekNS6qAqz9oS7CtSvgGJSppSNAYAIh7vrfrSdHj9zw==", "license": "Apache-2.0", "dependencies": { "@scarf/scarf": "=1.4.0" diff --git a/src/Swashbuckle.AspNetCore.SwaggerUI/package.json b/src/Swashbuckle.AspNetCore.SwaggerUI/package.json index 687608c626..3dbf46501f 100644 --- a/src/Swashbuckle.AspNetCore.SwaggerUI/package.json +++ b/src/Swashbuckle.AspNetCore.SwaggerUI/package.json @@ -3,7 +3,7 @@ "version": "1.0.0", "private": true, "dependencies": { - "swagger-ui-dist": "5.29.0" + "swagger-ui-dist": "5.29.1" }, "scripts": { "postinstall": "node scripts/remove-source-map-links.js"