From 885ddfd4a16595993ff0d316d0395d3b30521d60 Mon Sep 17 00:00:00 2001 From: dave Date: Tue, 19 Mar 2024 06:31:38 +0100 Subject: [PATCH] Swag --- src/HeartTrackAPI/Utils/AppBootstrap.cs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/HeartTrackAPI/Utils/AppBootstrap.cs b/src/HeartTrackAPI/Utils/AppBootstrap.cs index c41d828..73640c3 100644 --- a/src/HeartTrackAPI/Utils/AppBootstrap.cs +++ b/src/HeartTrackAPI/Utils/AppBootstrap.cs @@ -172,6 +172,7 @@ public class AppBootstrap(IConfiguration configuration) public void Configure(WebApplication app, IWebHostEnvironment env) { + app.UsePathBase("/codefirst"); app.UseHttpsRedirection(); app.MapIdentityApi(); @@ -183,9 +184,21 @@ public class AppBootstrap(IConfiguration configuration) // Configure the HTTP request pipeline. if (true) { + var apiVersionDescriptionProvider = app.Services.GetRequiredService(); app.UseSwagger(); - app.UseSwaggerUI(); + app.UseSwaggerUI(c => { + c.SwaggerEndpoint($"./v1/swagger.json", "SapWeb v1"); + }); app.MapSwagger(); +/* app.UseSwaggerUI(options => + { + foreach (var description in apiVersionDescriptionProvider.ApiVersionDescriptions) + { + options.SwaggerEndpoint($"/swagger/{description.GroupName}/swagger.json", + description.GroupName.ToUpperInvariant()); + } + });*/ + }