从 swagger 规范文件更新邮递员集合

编程入门 行业动态 更新时间:2024-10-27 02:22:43
本文介绍了从 swagger 规范文件更新邮递员集合的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在将一个 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 并更新现有集合,但所有测试、参数、pre-req 脚本都被删除,我需要重新配置所有.

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 目前不支持此功能.链接

Postman does not support this as of now. Link

我从这个博客中学到了另一种选择.简而言之:

Alternative I learned from this blog. In short:

  • 更新您的 OpenAPI YAML/JSON 文件.
  • 作为新集合导入 Postman.
  • 从 Postman 导出新集合.作为 Collection v2.1 格式的 JSON(推荐).
  • 使用 Postman API(更新集合),在步骤 3 中使用 JSON 更新现有集合作为身体.确保相应地更新 collection_uid.
  • Update your OpenAPI YAML/JSON files.
  • Import to Postman as a new collection.
  • Export the new collection from Postman. As JSON in Collection v2.1 format (recommended).
  • Using Postman API (Update Collection), update the existing collection with the JSON in step 3 as body. Make sure to update collection_uid accordingly.
  • Postman 更新集合 API 正文示例:

    Postman update collection API body sample:

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

    更多推荐

    从 swagger 规范文件更新邮递员集合

    本文发布于:2023-10-29 08:33:05,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/1539220.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:邮递员   文件   swagger

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!