Swagger UI end point is not same as dev in staging ( excluding domain names)
IIS Configuration
public void Configure(IApplicationBuilder app
It took me some time to get it running so i want to share my solution here
string vpath = s.GetValue("VirtualPath") ?? string.Empty;
if (string.IsNullOrWhiteSpace(vpath))
{
app.UseSwagger();
app.UseSwaggerUI(c => { c.SwaggerEndpoint("/swagger/v1/swagger.json", endpointName); });
}
else
{
app.UseSwagger(c =>
{
//no virtual path in the roue template it is relative
c.RouteTemplate = $"swagger/{{documentName}}/swagger.json";
//c.PreSerializeFilters.Add((swagger, request) => swagger.BasePath = $"/{vpath}");
});
app.UseSwaggerUI(options =>
{
//options.RoutePrefix = vpath;
//gives the location of the gennerated json file to the UI
//start with / to create an absolute path from the base directory
options.SwaggerEndpoint($"/{vpath}/swagger/v1/swagger.json", endpointName);
});
}