From 7b5c7579135dd5534b2948e7e39d19305089c070 Mon Sep 17 00:00:00 2001 From: Sullivan Lacheteau Date: Wed, 27 Nov 2024 18:40:47 -0500 Subject: [PATCH] fix: url consistency between Scalar UI and browser --- template/src/Placeholder.ServiceDefaults/Extensions.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/template/src/Placeholder.ServiceDefaults/Extensions.cs b/template/src/Placeholder.ServiceDefaults/Extensions.cs index a5143d9..3dad500 100644 --- a/template/src/Placeholder.ServiceDefaults/Extensions.cs +++ b/template/src/Placeholder.ServiceDefaults/Extensions.cs @@ -117,7 +117,12 @@ public static WebApplication ConfigureMiddlewares(this WebApplication app) if (app.Environment.IsDevelopment()) { app.MapOpenApi(); - app.MapScalarApiReference(); + app.MapScalarApiReference(options => + { + // This is necessary to ensure proper API url mapping between the Scalar UI and the browser + // See comments in https://dev.azure.com/nventive/Practice%20committees/_workitems/edit/305140 for more information + options.Servers = Array.Empty(); + }); } return app;