将 Swagger 规范 JSON 转换为 HTML 文档 [英] Converting Swagger specification JSON to HTML documentation

查看:98
本文介绍了将 Swagger 规范 JSON 转换为 HTML 文档的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于一些用 PHP 编写的 REST API,我被要求创建 Swagger 文档,因为我不知道任何向那些现有 API 添加注释并创建这样的文档的简单方法,我现在使用 这个编辑器 来生成一些.

我保存了使用该编辑器创建的 JSON 和 YAML 文件,现在我需要创建最终的交互式 Swagger 文档(此声明可能听起来幼稚和含糊).

有人可以告诉我如何将 Swagger JSON 规范文件转换为实际的 Swagger 文档吗?

我使用的是 Windows 平台,对 Ant/Maven 一无所知.

解决方案

当我正在寻找一个工具来做到这一点时,我对 swagger-codegen 并不满意,所以我自己写了一个.看看 bootprint-swagger

swagger-codegen 相比的主要目标是提供一个简单的设置(尽管你需要 nodejs).并且应该很容易根据自己的需要调整样式和模板,这是 bootprint-project

For some REST APIs written in PHP, I was asked to create Swagger documentation, and since I was not aware of any easy way of adding annotations to those existing APIs and create such a documentation, I used this editor to generate some for now.

I saved the JSON and YAML files created using that editor, and now I need to create the final interactive Swagger documentation (this statement might sound naive and vague).

Can someone please let me know how I can convert the Swagger JSON specification file to actual Swagger documentation?

I am on the Windows platform and do not know anything about Ant/Maven.

解决方案

I was not satisfied with swagger-codegen when I was looking for a tool to do this, so I wrote my own. Have a look at bootprint-swagger

The main goal compared to swagger-codegen is to provide an easy setup (though you'll need nodejs). And it should be easy to adapt styling and templates to your own needs, which is a core functionality of the bootprint-project

这篇关于将 Swagger 规范 JSON 转换为 HTML 文档的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆