.net core 使用swagger生成API文档
2021-06-04 17:03
标签:efi 接口 div was service .json star rdo empty 【1】安装Swashbuckle.AspNetCore包 【2】在Startup.cs中注册swagger 【3】在Startup.cs中配置swagger 【4】在launchSettings.json中修改启动地址 .net core 使用swagger生成API文档 标签:efi 接口 div was service .json star rdo empty 原文地址:https://www.cnblogs.com/mobaiyu/p/10844944.html//注册Swagger生成器,定义一个和多个Swagger 文档
services.AddSwaggerGen(c =>
{
c.SwaggerDoc("v1", new Info { Title = "爱住微订API", Version = "v1" });
});
app.UseSwagger();
app.UseSwaggerUI(c =>
{
c.SwaggerEndpoint("/swagger/v1/swagger.json", "爱住微订API V1");
c.RoutePrefix = string.Empty;//设置后直接输入IP就可以进入接口文档
});
"launchUrl": "swagger",
上一篇:创建接口调用--lambda与api_gateway结合
下一篇:Windows下C extension not loaded for Word2Vec, training will be slow.解决方法
文章标题:.net core 使用swagger生成API文档
文章链接:http://soscw.com/index.php/essay/90481.html