引用:
using Swashbuckle.AspNetCore.SwaggerUI;
using Swashbuckle.AspNetCore;
修改:Startup.cs 文件
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
app.UseHttpsRedirection();
app.UseRouting();
app.UseAuthorization();
app.UseEndpoints(endpoints =>
{
endpoints.MapControllers();
});
#region Swagger
app.UseSwagger();
app.UseSwaggerUI(c =>
{
c.SwaggerEndpoint("/swagger/v1/swagger.json", "ApiHelp V1");
c.DocExpansion(DocExpansion.None); //->修改界面打开时自动折叠
});
#endregion
}
————————————————
版权声明:本文为CSDN博主「吹口哨的兔子」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/z123191456/article/details/106665605/