yapi icon indicating copy to clipboard operation
yapi copied to clipboard

从postman导入api,不支持Collection v2 格式数据

Open liupengfei-gitsub opened this issue 4 years ago • 6 comments

版本号

~ 1.10.2 (2021-10-13)

什么问题

~从postman导入api,不支持Collection v2 没办法导出 v1版本,因为最新的postman只能导出 v2或者v2.1版本

如何复现此问题

~ 点击数据管理,数据导入,上传postman的json,Collection v2版本提示解析数据为空

什么浏览器

~ 谷歌浏览器

什么系统(Linux, Windows, macOS)

Windows

liupengfei-gitsub avatar Dec 09 '21 01:12 liupengfei-gitsub

检查电脑是否下载了node。没有的话先下载node.js,下载地址:https://nodejs.org/en/download/ 打开cmd,安装命令:npm install -g postman-collection-transformer(安装postman转换器) 转换postman脚本文件的版本。转换命令:postman-collection-transformer convert -i “转换文件路径” -o “转换后文件路径” -j 1.0.0 -p 2.0.0 -P eg:postman-collection-transformer convert -i “D:\Postman脚本\a.postman_collection.json” -o “D:\Postman脚本\a1.postman_collection.json” -j 1.0.0 -p 2.0.0 -P (将文件a转换后放在“D:\Postman脚本\”路径下,新文件名为a1)

https://learning.postman.com/docs/getting-started/importing-and-exporting-data/#converting-postman-collections-from-v1-to-v2

ran1990 avatar Dec 14 '21 06:12 ran1990

这个不是v1转v2吗?有v2转v1的么

MingZnb avatar Feb 14 '22 09:02 MingZnb

把这一部分反着写就行 -j 1.0.0 -p 2.0.0 -P V1 t V2 -j 2.0.0 -p 1.0.0 -P V2 t V1

Xy-pinko avatar Apr 14 '22 03:04 Xy-pinko

从postman导出v2,再转成v1,然后导入yapi,发现接口的分组信息已经没有了。 在postman中的分组: image 导入yapi后,接口全部被导入了一个分类,而postman中的分组被创建成了空的分类: image

misterchaos avatar Jun 23 '22 06:06 misterchaos

有v2转v1的吗

haqigit avatar May 22 '23 08:05 haqigit

postman-collection-transformer convert -i "C:\Users\user.DESKTOP-B10TK8C\Desktop\aa\a.postman_collection.json" -o "C:\Users\user.DESKTOP-B10TK8C\Desktop\aa\b.postman_collection.json" -j 2.0.0 -p 1.0.0 -P

ran1990 avatar May 23 '23 02:05 ran1990