i\'ve built a Web API in ASP.Net Core (version 1.1.2) and i use the Swashbuckle.AspNetCore for generating the swagger definition.
below is a part of the automaticall
BasePath was used in Swagger v2.0 It has been replaced by the servers array in OpenApi v3.0
In v5 you have to do this for using OpenApi v3.0:
var basePath = "/v1";
app.UseSwagger(c =>
{
c.RouteTemplate = "swagger/{documentName}/swagger.json";
c.PreSerializeFilters.Add((swaggerDoc, httpReq) =>
{
swaggerDoc.Servers = new List { new OpenApiServer { Url = $"{httpReq.Scheme}://{httpReq.Host.Value}{basePath}" } };
});
});