【问题标题】:How to convert apiDoc to postman collection?如何将 apiDoc 转换为邮递员收藏?
【发布时间】:2018-03-31 05:57:40
【问题描述】:

我有一个 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 创建邮递员集合吗?

【问题讨论】:

    标签: postman api-doc postman-collection


    【解决方案1】:

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

    1.导出到 Swagger

    • 安装这个npm-package

    • npm install apidoc-swagger -g

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

    2.在 Postman 中导入

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

    npm 包可能无法工作,因为它看起来已经过时了。

    【讨论】:

    • 谢谢:D!我检查了这个 npm 模块,我在代码上发现了一些错误,但最终我修复了它们,结果(*.json)很好。
    • @KrauszLórántSzilveszter 很好,不客气,谢谢:D 你能分享你的编辑吗?
    • 该库不再维护。风险自负。
    猜你喜欢
    • 2017-08-21
    • 2019-10-14
    • 2018-03-05
    • 1970-01-01
    • 1970-01-01
    • 2020-08-16
    • 2020-02-11
    • 2017-11-27
    • 1970-01-01
    相关资源
    最近更新 更多