Skip to content

Commit

Permalink
add docs
Browse files Browse the repository at this point in the history
  • Loading branch information
luoyunchong committed Aug 12, 2020
1 parent 5ea5c57 commit b0bbd40
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,24 @@ app.UseEndpoints(endpoints =>
});
```

5.更多功能

为文档添加注释 在项目上右键--属性--生成

![](https://pic.downk.cc/item/5f34161d14195aa59413f0fc.jpg)

在AddSwaggerGen方法中添加如下代码

```
c.IncludeXmlComments(Path.Combine(AppContext.BaseDirectory, "SwaggerDemo.xml"),true);
```
最后一个参数设置为true,代表启用控制器上的注释

运行后如看不到控制器上注释显示,请点开文档管理->个性化设置,开启分组tag显示description说明属性

![](https://pic.downk.cc/item/5f34171114195aa594142d2e.jpg)



### 🔎 效果图
运行项目,打开 https://localhost:5001/index.html#/home
Expand Down

0 comments on commit b0bbd40

Please sign in to comment.