我想在services.AddSwaggerGen中的config.SwaggerDoc中添加两个版本来实现Swagger
例如:
services.AddSwaggerGen(
config =>
{
config.SwaggerDoc("v1.1", new OpenApiInfo { Title = "BookingApis V1", Version = "v1.1", Description = "Developed By Demon" });
config.SwaggerDoc("v2", new OpenApiInfo { Title = "BookingApis V2", Version = "v2", Description = "Developed By Demon" });
})中;
这些设置对于我在Asp.NET和.core6中实现swagger是必要的,这些设置在服务部分的启动中添加。AddSwaggerGen
1条答案
按热度按时间bxjv4tth1#
我发现这个问题你的答案是: