實測總結:導入Postman Collection v1的JSON file能成功
版本環(huán)境
Postman 版本:8.11.1
YAPI 版本:1.12.0
問題解決
如果Postman能直接導出v1的JSON file就不需要繼續(xù)以下步驟;
可惜Postman v8.11.1 當前版本不支持導出v1。
需要使用postman-collection-transformer工具進行轉(zhuǎn)換v2 -> v1
Postman官網(wǎng)版本轉(zhuǎn)換介紹
# 外網(wǎng)直接安裝工具執(zhí)行版本轉(zhuǎn)換即可
npm install -g postman-collection-transformer
postman-collection-transformer convert -i <path to the input Postman Collection file> -o <path to the downloaded Postman file> -j 2.0.0 -p 1.0.0 -P
如果沒有npm,則安裝nodejs環(huán)境
下載鏈接: nodejs官網(wǎng)
我使用的windows .msi安裝方式,雙擊一直下一步就行
當前安裝完成后的版本:
npm -v
9.5.0
node -v
v18.15.0
附:內(nèi)網(wǎng)環(huán)境
(我是保證內(nèi)外網(wǎng)nodejs版本號一致的)
# 1.安裝postman-collection-transformer
npm install -g postman-collection-transformer
# 2.任意位置創(chuàng)建文件夾postman-collection-transformer
# 3.進入文件夾postman-collection-transformer
# 打開cmd
# 這邊生成了package.json文件
npm init --yes
# 4.安裝postman-collection-transformer相關依賴包到此目錄
npm install postman-collection-transformer –save # -save就是將package.json文件相關模塊存儲到當前目錄中
# 5.將整個postman-collection-transformer文件夾拷到內(nèi)網(wǎng)
# 6.進入此文件夾打開cmd進行安裝
npm install -g postman-collection-transformer
至此,問題解決。
解決問題參考鏈接文章來源:http://www.zghlxwxcb.cn/news/detail-465784.html
YMFE/yapi - Issues
npm包離線安裝文章來源地址http://www.zghlxwxcb.cn/news/detail-465784.html
到了這里,關于Postman導出json v2/v2.1文件導入YAPI報錯:解析數(shù)據(jù)為空的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關文章,希望大家以后多多支持TOY模板網(wǎng)!