feat: add backend version to swagger

This commit is contained in:
2025-02-10 16:07:51 +03:00
parent e79ec360ea
commit aabeed0aa5
2 changed files with 4 additions and 1 deletions

View File

@ -4,6 +4,8 @@ using Microsoft.Extensions.Options;
using Microsoft.OpenApi.Models; using Microsoft.OpenApi.Models;
using Swashbuckle.AspNetCore.SwaggerGen; using Swashbuckle.AspNetCore.SwaggerGen;
using System; using System;
using System.Diagnostics;
using System.Reflection;
namespace Mirea.Api.Endpoint.Configuration.SwaggerOptions; namespace Mirea.Api.Endpoint.Configuration.SwaggerOptions;
@ -19,7 +21,7 @@ public class ConfigureSwaggerOptions(IApiVersionDescriptionProvider provider) :
{ {
var info = new OpenApiInfo() var info = new OpenApiInfo()
{ {
Title = "MIREA Schedule Web API", Title = $"MIREA Schedule Web API ({FileVersionInfo.GetVersionInfo(Assembly.GetExecutingAssembly().Location).ProductVersion})",
Version = description.ApiVersion.ToString(), Version = description.ApiVersion.ToString(),
Description = "This API provides a convenient interface for retrieving data stored in the database. " + 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.", "Special attention was paid to the lightweight and easy transfer of all necessary data. Made by the Winsomnia team.",

View File

@ -19,6 +19,7 @@
<GenerateDocumentationFile>True</GenerateDocumentationFile> <GenerateDocumentationFile>True</GenerateDocumentationFile>
<DocumentationFile>docs.xml</DocumentationFile> <DocumentationFile>docs.xml</DocumentationFile>
<NoWarn>$(NoWarn);1591</NoWarn> <NoWarn>$(NoWarn);1591</NoWarn>
<IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>