From 93a1b6ea8ef47b69fbf51d3cdf484f3461778266 Mon Sep 17 00:00:00 2001 From: Polianin Nikita Date: Sun, 28 Jan 2024 06:29:47 +0300 Subject: [PATCH] refactor move files --- Endpoint/{ => Configuration}/SwaggerDefaultValues.cs | 4 ++-- Endpoint/Program.cs | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) rename Endpoint/{ => Configuration}/SwaggerDefaultValues.cs (93%) diff --git a/Endpoint/SwaggerDefaultValues.cs b/Endpoint/Configuration/SwaggerDefaultValues.cs similarity index 93% rename from Endpoint/SwaggerDefaultValues.cs rename to Endpoint/Configuration/SwaggerDefaultValues.cs index d47c591..cefb307 100644 --- a/Endpoint/SwaggerDefaultValues.cs +++ b/Endpoint/Configuration/SwaggerDefaultValues.cs @@ -6,7 +6,7 @@ using System; using System.Linq; using System.Text.Json; -namespace Mirea.Api.Endpoint; +namespace Mirea.Api.Endpoint.Configuration; public class SwaggerDefaultValues : IOperationFilter { @@ -38,7 +38,7 @@ public class SwaggerDefaultValues : IOperationFilter { var description = apiDescription.ParameterDescriptions.First(p => p.Name == parameter.Name); - parameter.Description ??= description.ModelMetadata?.Description; + parameter.Description ??= description.ModelMetadata.Description; if (parameter.Schema.Default == null && description.DefaultValue != null && diff --git a/Endpoint/Program.cs b/Endpoint/Program.cs index 920ce15..c71f6c9 100644 --- a/Endpoint/Program.cs +++ b/Endpoint/Program.cs @@ -8,6 +8,8 @@ using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Options; using Mirea.Api.DataAccess.Application; using Mirea.Api.DataAccess.Persistence; +using Mirea.Api.Endpoint.Configuration; +using Mirea.Api.Endpoint.Middleware; using Mirea.Api.Endpoint.Properties; using Swashbuckle.AspNetCore.SwaggerGen; using System;