为何要本地编辑:
- swagger是外国网站,不知道为何,这个工具网站被中国防火墙给挡住了(咱也不敢问为什么)。导致我没办法通过swagger进行线上编辑。
本地编辑swagger并集成到aws的方式
- 到aws api gateway>>对应的API>>>stages>>Export>>导出swagger的文档。
- 到 https://github.com/swagger-api/swagger-editor 在本地运行起swagger-editor(需要安装docker)
- 浏览 http://localhost/>>>File>>import file >>>选择从aws api gateway导出的swagger文档导入
- 在 http://localhost/ 编辑完成后,保存 >>File>>save as YAML
- 到aws api gateway>>对应的API>Actions>>Import API >>选择上一步保存的文件。如果没有报错就可以部署测试了。
转载于:https://www.jianshu.com/p/10b0801d0321