services.AddSwaggerGen(c => { c.SwaggerDoc("v1", new Microsoft.OpenApi.Models.OpenApiInfo { Title = "城更移动后台服务", Version = "v1" }); string directoryName = Path.GetDirectoryName(typeof(Program).Assembly.Location); string filePath = Path.Combine(directoryName, "CangShi.CityUpdate.Web.xml"); c.IncludeXmlComments(filePath); });
app.UseSwagger(); //启用中间件服务对swagger-ui,指定Swagger JSON终结点 app.UseSwaggerUI(c => { c.SwaggerEndpoint("/swagger/v1/swagger.json", "My API V1"); });