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

Kra*_*ter 5 api-doc postman postman-collection

我有一个 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.
...
..
    */
Run Code Online (Sandbox Code Playgroud)

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

Ano*_*cem 4

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

1.导出到Swagger

  • 安装这个npm 包

  • npm 安装 apidoc-swagger -g

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

2.在Postman中导入

Postman 支持 swagger 文件,因此您可以毫无问题地导入它,您可以在此处阅读“导入 swagger”部分。

npm 包可能无法工作,因为它似乎已经过时了。