答案 0 :(得分:0)
可以分享您的代码吗?您需要像下面这样在Startup.cs文件中配置设置
public void ConfigureServices(IServiceCollection services)
{
services.AddSwaggerGen(c =>
{
c.SwaggerDoc("v1", new Info
{
Version = "v1",
Title = "some title",
Description = "Web API",
TermsOfService = "None",
Contact = new Contact()
{
Name = "some name",
Email = "someemail@xxxx.com",
Url = "<url>"
}
});
c.OperationFilter<FileUploadOperation>();
});
}
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
app.UseSwagger();
app.UseSwaggerUI(c =>
{
c.SwaggerEndpoint("/swagger/v1/swagger.json", "my api 12345");
});
}