Postman Linux版API文档生成步骤
若尚未安装Postman,可通过以下命令下载并安装(适用于大多数Linux发行版):
Postman-linux-x64-xx.xx.xx.tar.gz);tar -xvf Postman-linux-x64-xx.xx.xx.tar.gz -C /opt;sudo ln -s /opt/Postman/Postman /usr/bin/postman。{"code": 200, "data": {"id": 123, "name": "John"}})、失败示例(如参数缺失的返回{"code": 400, "message": "Missing required parameter"})和异常示例(如服务器错误的返回{"code": 500, "message": "Internal Server Error"});https://documenter.getpostman.com/view/xxxxxx);docgen: 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 build -i ~/Downloads/Api_Test_postman_collection.json -o ~/Downloads/Api_Test_postman_collection.html -m(-m参数表示生成Markdown格式)。newman: wget https://dl.pstmn.io/download/latest/linux64 -O postman.tar.gz;/opt目录:sudo tar -xzf postman.tar.gz -C /opt;sudo ln -s /opt/Postman/Postman /usr/bin/postman;newman run /path/to/postman_collection.json -e /path/to/postman_environment.json -o /path/to/output.html(-e为可选的环境变量文件)。