如何从摇摇欲坠的文档中生成一个静态的html文件? [英] How to generate a static html file from a swagger documentation?
问题描述
我创建了一个Swagger文档,其中的 yaml
文件位于:
I have created a Swagger documentation with a yaml
file under:
api/swagger/swagger.yaml
Now I want to share a static HTML document with its definition, yet it was stated on the swagger project, that they don't plan to support HTML generation at all.
如何从Swagger项目生成静态HTML文件?
How can I generate a static HTML file from a Swagger project?
推荐答案
我想到的最简单的方法是使用 Swagger编辑器:
The easiest way I can think of is to use Swagger Editor:
- 转到: https://editor.swagger.io
- 单击顶部菜单栏中的文件",然后选择导入文件"
- 导入后,单击顶部菜单栏中的生成客户端",然后选择"HTML"或"HTML2"以生成静态HTML文档
editor.swagger.io使用generator.swagger.io生成API客户端,服务器存根和文档,并且generator.swagger.io由开源项目
editor.swagger.io uses generator.swagger.io to generate API clients, server stubs and documentation, and generator.swagger.io is powered by the open-source project Swagger Codegen.
这篇关于如何从摇摇欲坠的文档中生成一个静态的html文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!