swagger-editor 快速REST-API 测试文档编写

1. 在线使用

 http://editor.swagger.io/#/

2. 离线工具

 https://github.com/swagger-api/swagger-editor

3. 跨域访问问题:

  服务添加一下 http 响应头(不同服务器配置可能不同,可以搜索对应的资料):

Access-Control-Allow-Origin: *
Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept

 4. docker 安装

docker pull swaggerapi/swagger-editor
docker run -p 80:8080 swaggerapi/swagger-editor
原文地址:https://www.cnblogs.com/rongfengliang/p/5576628.html