From 52de98969dee421b2275eb892ebb8812a03d628e Mon Sep 17 00:00:00 2001 From: Polianin Nikita Date: Sat, 1 Feb 2025 20:45:08 +0300 Subject: [PATCH] refactor: remove unused brackets --- .../Configuration/SwaggerOptions/ConfigureSwaggerOptions.cs | 2 -- Endpoint/Configuration/SwaggerOptions/SwaggerDefaultValues.cs | 4 ---- 2 files changed, 6 deletions(-) diff --git a/Endpoint/Configuration/SwaggerOptions/ConfigureSwaggerOptions.cs b/Endpoint/Configuration/SwaggerOptions/ConfigureSwaggerOptions.cs index eae4d2e..2de861c 100644 --- a/Endpoint/Configuration/SwaggerOptions/ConfigureSwaggerOptions.cs +++ b/Endpoint/Configuration/SwaggerOptions/ConfigureSwaggerOptions.cs @@ -12,9 +12,7 @@ public class ConfigureSwaggerOptions(IApiVersionDescriptionProvider provider) : public void Configure(SwaggerGenOptions options) { foreach (var description in provider.ApiVersionDescriptions) - { options.SwaggerDoc(description.GroupName, CreateInfoForApiVersion(description)); - } } private static OpenApiInfo CreateInfoForApiVersion(ApiVersionDescription description) diff --git a/Endpoint/Configuration/SwaggerOptions/SwaggerDefaultValues.cs b/Endpoint/Configuration/SwaggerOptions/SwaggerDefaultValues.cs index 290f981..a6b9dd4 100644 --- a/Endpoint/Configuration/SwaggerOptions/SwaggerDefaultValues.cs +++ b/Endpoint/Configuration/SwaggerOptions/SwaggerDefaultValues.cs @@ -23,16 +23,12 @@ public class SwaggerDefaultValues : IOperationFilter foreach (var contentType in response.Content.Keys) { if (responseType.ApiResponseFormats.All(x => x.MediaType != contentType)) - { response.Content.Remove(contentType); - } } } if (operation.Parameters == null) - { return; - } foreach (var parameter in operation.Parameters) {