📜  无法生成 swagger 文件.错误 dotnet swagger tofile --serializeasv2 --output - C# 代码示例

📅  最后修改于: 2022-03-11 14:49:22.360000             🧑  作者: Mango

代码示例1
Add below to the Configuration function of the Startup.cs file.
Make sure you use the same name ("test" here) and the "API URL suffix" in Azure.

services.AddSwaggerGen(c =>
{
    c.SwaggerDoc("test", new OpenApiInfo { Title = "TestAPI", Version = "v1" });
});

In the web deployment profile add below line under 

v1