From aabeed0aa5dbb8a97ea9f76af58db7b14607fda5 Mon Sep 17 00:00:00 2001 From: Polianin Nikita Date: Mon, 10 Feb 2025 16:07:51 +0300 Subject: [PATCH] feat: add backend version to swagger --- .../Configuration/SwaggerOptions/ConfigureSwaggerOptions.cs | 4 +++- Endpoint/Endpoint.csproj | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Endpoint/Configuration/SwaggerOptions/ConfigureSwaggerOptions.cs b/Endpoint/Configuration/SwaggerOptions/ConfigureSwaggerOptions.cs index 2de861c..8b40ca0 100644 --- a/Endpoint/Configuration/SwaggerOptions/ConfigureSwaggerOptions.cs +++ b/Endpoint/Configuration/SwaggerOptions/ConfigureSwaggerOptions.cs @@ -4,6 +4,8 @@ using Microsoft.Extensions.Options; using Microsoft.OpenApi.Models; using Swashbuckle.AspNetCore.SwaggerGen; using System; +using System.Diagnostics; +using System.Reflection; namespace Mirea.Api.Endpoint.Configuration.SwaggerOptions; @@ -19,7 +21,7 @@ public class ConfigureSwaggerOptions(IApiVersionDescriptionProvider provider) : { var info = new OpenApiInfo() { - Title = "MIREA Schedule Web API", + Title = $"MIREA Schedule Web API ({FileVersionInfo.GetVersionInfo(Assembly.GetExecutingAssembly().Location).ProductVersion})", Version = description.ApiVersion.ToString(), Description = "This API provides a convenient interface for retrieving data stored in the database. " + "Special attention was paid to the lightweight and easy transfer of all necessary data. Made by the Winsomnia team.", diff --git a/Endpoint/Endpoint.csproj b/Endpoint/Endpoint.csproj index 6f8bd07..7fdde78 100644 --- a/Endpoint/Endpoint.csproj +++ b/Endpoint/Endpoint.csproj @@ -19,6 +19,7 @@ True docs.xml $(NoWarn);1591 + false