mirror of
https://github.com/nsnail/IGeekFan.AspNetCore.Knife4jUI.git
synced 2025-04-16 23:52:49 +08:00
add docs
This commit is contained in:
parent
5ea5c57450
commit
b0bbd40621
18
README.md
18
README.md
@ -73,6 +73,24 @@ app.UseEndpoints(endpoints =>
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
5.更多功能
|
||||||
|
|
||||||
|
为文档添加注释 在项目上右键--属性--生成
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
在AddSwaggerGen方法中添加如下代码
|
||||||
|
|
||||||
|
```
|
||||||
|
c.IncludeXmlComments(Path.Combine(AppContext.BaseDirectory, "SwaggerDemo.xml"),true);
|
||||||
|
```
|
||||||
|
最后一个参数设置为true,代表启用控制器上的注释
|
||||||
|
|
||||||
|
运行后如看不到控制器上注释显示,请点开文档管理->个性化设置,开启分组tag显示description说明属性
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### 🔎 效果图
|
### 🔎 效果图
|
||||||
运行项目,打开 https://localhost:5001/index.html#/home
|
运行项目,打开 https://localhost:5001/index.html#/home
|
||||||
|
Loading…
x
Reference in New Issue
Block a user