从swagger规范文件更新邮递员收藏 [英] Update postman collection from swagger specification file

查看:93
本文介绍了从swagger规范文件更新邮递员收藏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在将一个摇摇欲坠的规范文件导入邮递员以创建一个集合,这时,它可以按预期工作,并且该集合随所有请求生成。子文件夹,很好!!但是在更新api时,我需要更新邮递员,以根据新规范更新所有请求。我找不到类似更新之类的操作。我正在尝试将新规范导入邮递员,他说:

I'm importing a swagger specification file into postman to create a collection, at this point, works as expected and the collection is generated with all requests & sub-folders, fine!!. But when the api is updated, I need update the postman to update all requests based on the new specification. I can't find a action like "update" or something else. I'm trying import the new specification into postman and he say:


集合APIName已经存在。
您想做什么?

A collection APIName already exists. What would you like to do?

替换作为副本导入

一个副本是不可行的选择,然后我使用 replace 并更新了现有的集合,但是所有测试,参数,前提条件脚本都已删除,我需要重新配置所有内容。

a copy its a not feasible option, then I use replace and the existent collection is updated, but all tests, parameters, pre-req scripts are remove and I need reconfigure all again.

我丢失了某种东西,存在一种导入&从规范文件更新现有集合,而不会丢失现有测试&配置?

I'm missing something, exist a way to import & update a existent collection from a specification file, without losing existent tests & configuration?

预先感谢!

推荐答案

邮递员不支持截至目前。 链接

Postman does not support this as of now. Link

我从博客。简而言之:


  1. 更新您的OpenAPI YAML / JSON文件。

  2. 作为新文件导入邮递员

  3. 从Postman导出新收藏。作为Collection v2.1格式的JSON(推荐)。

  4. 使用邮递员API (更新集合),使用步骤3中的JSON作为正文更新现有集合。 请确保相应地 collection_uid

  1. Update your OpenAPI YAML/JSON files.
  2. Import to Postman as a new collection.
  3. Export the new collection from Postman. As JSON in Collection v2.1 format (recommended).
  4. Using Postman API (Update Collection), update the existing collection with the JSON in step 3 as body. Make sure to collection_uid accordingly.

邮递员更新集合API主体示例:

Postman update collection API body sample:

{
  "collection": 
  <------- YOUR EXPORTED COLLECTION HERE --------->
}

这篇关于从swagger规范文件更新邮递员收藏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆