首先控制台安装SwashbucklAspNetCore-Version版本号-rc4包
public void ConfigureServices(IServiceCollection services)
{
#region apiSettings
services.AddSwaggerGen(m => m.SwaggerDoc('v1', new OpenApiInfo { Title = 'Web Shopping Mall', Version = 'v1' }));
#endregion
}
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
#region apiSettings
app.UseSwaggerUI(m => m.SwaggerEndpoint('/swagger/v1/swagger.json', 'Web Shopping Mall'));
#endregion
}
文章为作者独立观点,不代表 股票程序化软件自动交易接口观点