From 4f0cf6acd4421aa706641ec7afc850735c9641eb Mon Sep 17 00:00:00 2001 From: "Tizian.Breuch" Date: Fri, 1 Aug 2025 10:43:06 +0200 Subject: [PATCH] order --- Webshop.Api/Program.cs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Webshop.Api/Program.cs b/Webshop.Api/Program.cs index 096dee7..16bf36c 100644 --- a/Webshop.Api/Program.cs +++ b/Webshop.Api/Program.cs @@ -165,6 +165,21 @@ builder.Services.AddSwaggerGen(c => return new[] { tag }; }); + c.OrderActionsBy(apiDesc => + { + var relativePath = apiDesc.RelativePath ?? ""; + + if (relativePath.StartsWith("api/v1/auth")) return "1"; // Auth ganz oben + if (relativePath.StartsWith("api/v1/admin")) return "2"; // Admin als letztes + if (relativePath.StartsWith("api/v1/customer")) return "3"; // Customer danach + if (relativePath.StartsWith("api/v1/public")) return "4"; // Public als nächstes + + + + return "5"; // Fallback + }); + + // --- 2. JWT Security Konfiguration --- c.AddSecurityDefinition("Bearer", new OpenApiSecurityScheme {