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