Ubuntu上Postman生成接口文档的实用步骤
一 在Postman中准备与编写文档
二 在Postman中预览与发布文档
三 导出与离线分享
wget https://raw.githubusercontent.com/thedevsaddam/docgen/v3/install.sh -O install.sh && sudo chmod +x install.sh && sudo ./install.sh && rm install.sh
docgen server -f ~/Downloads/Api_Test_postman_collection.json -p 8000
docgen build -i ~/Downloads/Api_Test_postman_collection.json -o ~/Downloads/Api_Test_postman_collection.html
docgen build -i ~/Downloads/Api_Test_postman_collection.json -o ~/Downloads/Api_Test_postman_collection.md -m
四 命令行自动化生成文档
# 安装 Newman(需已安装 Node.js)
npm install -g newman
# 基本运行并导出HTML报告
newman run /path/to/collection.json -e /path/to/environment.json -r html --reporter-html-export report.html