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 {