mirror of
https://github.com/YMFE/yapi.git
synced 2024-12-09 05:00:30 +08:00
opti: docs
This commit is contained in:
parent
92a4fdb068
commit
69b42c6799
@ -37,6 +37,7 @@
|
||||
* [HAR 数据导入](data.md#HAR 数据导入)
|
||||
* [Swagger 数据导入](data.md#Swagger 数据导入)
|
||||
* [JSON 数据导入](data.md#YApi接口JSON数据导入)
|
||||
* [通过命令行导入接口数据](data.md#通过命令行导入接口数据)
|
||||
* [数据导出](export-data.md)
|
||||
|
||||
|
||||
|
@ -48,4 +48,38 @@
|
||||
## YApi接口JSON数据导入
|
||||
该功能在 v1.3.12 版本上线,可导入在 yapi 平台导出的 json 接口数据。
|
||||
|
||||
![](import-json-data.png)
|
||||
![](import-json-data.png)
|
||||
|
||||
|
||||
## 通过命令行导入接口数据
|
||||
YApi 支持通过命令行导入接口数据,他的应用场景是做自动化集成,比如配合 swagger ,接口文档前端不用维护,交由后端生成。
|
||||
|
||||
### 使用方法
|
||||
|
||||
第一步,确保 `yapi-cli >= 1.2.6` 版本,如果低于此版本请升级 `yapi-cli` 工具
|
||||
|
||||
```
|
||||
npm install -g yapi-cli
|
||||
```
|
||||
|
||||
第二步,新建配置文件 `yapi-import.json`,如下所示:
|
||||
```json
|
||||
{
|
||||
"type": "swagger",
|
||||
"token": "17fba0027f300248b804",
|
||||
"file": "swagger.json",
|
||||
"server": "http://yapi.local.qunar.com:3000"
|
||||
}
|
||||
```
|
||||
|
||||
`token` 是项目token,在 `项目设置 -> token` 设置获取
|
||||
|
||||
`file` 是 swagger 接口文档文件,可使用绝对路径或 url
|
||||
|
||||
`server` 是yapi服务器地址
|
||||
|
||||
第三步,在新建配置文件的当前目录,执行下面指令
|
||||
|
||||
```
|
||||
yapi import
|
||||
```
|
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -726,6 +726,16 @@ window.ydoc_plugin_search_json = {
|
||||
"title": "YApi接口JSON数据导入",
|
||||
"url": "/documents/data.html#yapi接口json数据导入",
|
||||
"content": "YApi接口JSON数据导入该功能在 v1.3.12 版本上线,可导入在 yapi 平台导出的 json 接口数据。"
|
||||
},
|
||||
{
|
||||
"title": "通过命令行导入接口数据",
|
||||
"url": "/documents/data.html#通过命令行导入接口数据",
|
||||
"content": "通过命令行导入接口数据YApi 支持通过命令行导入接口数据,他的应用场景是做自动化集成,比如配合 swagger ,接口文档前端不用维护,交由后端生成。"
|
||||
},
|
||||
{
|
||||
"title": "使用方法",
|
||||
"url": "/documents/data.html#通过命令行导入接口数据-使用方法",
|
||||
"content": "使用方法第一步,确保 yapi-cli >= 1.2.6 版本,如果低于此版本请升级 yapi-cli 工具npm install -g yapi-cli第二步,新建配置文件 yapi-import.json,如下所示:{ \"type\": \"swagger\",\n \"token\": \"17fba0027f300248b804\",\n \"file\": \"swagger.json\",\n \"server\": \"http://yapi.local.qunar.com:3000\"\n}\ntoken 是项目token,在 项目设置 -> token 设置获取file 是 swagger 接口文档文件,可使用绝对路径或 urlserver 是yapi服务器地址第三步,在新建配置文件的当前目录,执行下面指令yapi import"
|
||||
}
|
||||
]
|
||||
},
|
||||
@ -753,6 +763,16 @@ window.ydoc_plugin_search_json = {
|
||||
"title": "YApi接口JSON数据导入",
|
||||
"url": "/documents/data.html#yapi接口json数据导入",
|
||||
"content": "YApi接口JSON数据导入该功能在 v1.3.12 版本上线,可导入在 yapi 平台导出的 json 接口数据。"
|
||||
},
|
||||
{
|
||||
"title": "通过命令行导入接口数据",
|
||||
"url": "/documents/data.html#通过命令行导入接口数据",
|
||||
"content": "通过命令行导入接口数据YApi 支持通过命令行导入接口数据,他的应用场景是做自动化集成,比如配合 swagger ,接口文档前端不用维护,交由后端生成。"
|
||||
},
|
||||
{
|
||||
"title": "使用方法",
|
||||
"url": "/documents/data.html#通过命令行导入接口数据-使用方法",
|
||||
"content": "使用方法第一步,确保 yapi-cli >= 1.2.6 版本,如果低于此版本请升级 yapi-cli 工具npm install -g yapi-cli第二步,新建配置文件 yapi-import.json,如下所示:{ \"type\": \"swagger\",\n \"token\": \"17fba0027f300248b804\",\n \"file\": \"swagger.json\",\n \"server\": \"http://yapi.local.qunar.com:3000\"\n}\ntoken 是项目token,在 项目设置 -> token 设置获取file 是 swagger 接口文档文件,可使用绝对路径或 urlserver 是yapi服务器地址第三步,在新建配置文件的当前目录,执行下面指令yapi import"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user