diff --git a/Webshop.Api/Program.cs b/Webshop.Api/Program.cs index 61df538..9604424 100644 --- a/Webshop.Api/Program.cs +++ b/Webshop.Api/Program.cs @@ -6,6 +6,7 @@ using Microsoft.EntityFrameworkCore; using Microsoft.IdentityModel.Tokens; using Microsoft.OpenApi.Models; using Resend; +using System.Reflection; using System.Text; using System.Text.Json.Serialization; @@ -195,6 +196,18 @@ builder.Services.AddSwaggerGen(c => c.OperationFilter(); c.OperationFilter(); c.OperationFilter(); + + var apiXmlFile = $"{Assembly.GetExecutingAssembly().GetName().Name}.xml"; + var apiXmlPath = Path.Combine(AppContext.BaseDirectory, apiXmlFile); + c.IncludeXmlComments(apiXmlPath); + + var appXmlFile = "Webshop.Application.xml"; // Der Name der DLL des Application-Projekts + .xml + var appXmlPath = Path.Combine(AppContext.BaseDirectory, appXmlFile); + if (File.Exists(appXmlPath)) + { + c.IncludeXmlComments(appXmlPath); + } + }); var app = builder.Build(); diff --git a/Webshop.Api/Webshop.Api.csproj b/Webshop.Api/Webshop.Api.csproj index c0e7068..635197b 100644 --- a/Webshop.Api/Webshop.Api.csproj +++ b/Webshop.Api/Webshop.Api.csproj @@ -6,6 +6,7 @@ enable 461c56b2-b056-42a9-8ce5-ccc441ef8a37 Linux + true