如何将apiDoc转换为邮递员集合?

时间:2017-10-19 08:35:43

标签: postman api-doc

我有一个nodejs项目,其中有许多请求已经实现并且由apiDoc记录良好,我想从中创建一个Postman集合!

> example:

/**
     * @api {GET} config/updates Updates - Get the latest event updates
     * @apiGroup Config service
     * @apiDescription This api endpoint provides the latest updates that need to be fetched by the client. It provides
         * an array of events, based on either the latestupdate (timestamp) param, or a configured interval (currently default to 1 minute.
...
..
    */

可以从apiDoc创建邮递员集合吗?

1 个答案:

答案 0 :(得分:2)

您可以将apiDoc导出到Swagger,然后将其导入Postman。

1.Export to Swagger

  • 安装此npm-package

  • npm install apidoc-swagger -g

  • apidoc-swagger -i example / -o doc /(示例是输入,doc是输出)

2.Import in Postman

Postman支持swagger文件,因此您可以导入它而不会出现您可以阅读的问题here阅读'Importing swagger'部分。

npm包可能无效,因为它似乎过时了。