我为dotnet swagger gen设置了以下配置:
builder.Services.AddSwaggerGen(c =>
{
c.SwaggerDoc("v1", new OpenApiInfo
{
Title = "Demo",
Version = "v1",
Description = "This is a demo api"
});
var xmlFile = $"{Assembly.GetExecutingAssembly().GetName().Name}.xml";
var xmlPath = Path.Combine(AppContext.BaseDirectory, xmlFile);
c.IncludeXmlComments(xmlPath);
});
有没有什么方法可以配置,以便当用户转到localhost:port/ lands时直接转到swagger docs?
1条答案
按热度按时间mzsu5hc01#
是的,您需要更改swagger UI的配置: