一、Swagger接口文档描述显示注释内容
①右击项目属性=>生成=>输出
②Swagger配置
services.AddSwaggerGen(config => { #region 配置API文档说明 config.SwaggerDoc("v1", new OpenApiInfo { Version = "v1", Title = "FirstPropertiesBackendAPI", Description = "接口文档", Contact = new OpenApiContact { Name = "Name", Email = "test" } }); var basePath = AppContext.BaseDirectory; var xmlPath = Path.Combine(basePath, "FirstPropertiesBackendAPI.xml"); config.IncludeXmlComments(xmlPath, true); #endregion });
app.UseSwagger(); app.UseSwaggerUI(c => c.SwaggerEndpoint("/swagger/v1/swagger.json", "FirstPropertiesBackendAPI v1"));
标签:接口,v1,文档,FirstPropertiesBackendAPI,Swagger,config From: https://www.cnblogs.com/jf-ace/p/17240456.html