从swagger规范文件更新邮递员收藏

编程入门 行业动态 更新时间:2024-10-28 16:28:31
本文介绍了从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

我从博客。简而言之:

  • 更新您的OpenAPI YAML / JSON文件。
  • 作为新文件导入邮递员
  • 从Postman导出新收藏。作为Collection v2.1格式的JSON(推荐)。
  • 使用邮递员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 collection_uid accordingly.
  • 邮递员更新集合API主体示例:

    Postman update collection API body sample:

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

    更多推荐

    从swagger规范文件更新邮递员收藏

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

    发布评论

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

    >www.elefans.com

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