From b54fd490266fca24da747aedc2a9442b97cc3812 Mon Sep 17 00:00:00 2001 From: "Tizian.Breuch" Date: Tue, 12 Aug 2025 12:03:58 +0200 Subject: [PATCH] swagger summary --- Webshop.Api/Program.cs | 13 +++++++++++++ Webshop.Api/Webshop.Api.csproj | 1 + 2 files changed, 14 insertions(+) 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