ReDoc 是否有类似于 Swagger 编辑器的实时编辑器?

Does ReDoc have a live editor similar to the Swagger Editor?

我已经开始使用 ReDoc 来发布我的文档,但是在将它推送到我的 Web 服务器之前没有一个好的方法来了解它的外观。我过去使用过 http://editor.swagger.io/,发现它非常有用。 ReDoc 有类似的东西吗?

是的,如果你使用这个项目:https://github.com/Rebilly/generator-openapi-repo#features

您可以使用 swagger 编辑器。它不会呈现 ReDoc 的预览,但您可以拥有本地开发环境 运行 并观看浏览器 window 重新加载。要启动本地开发环境,请参阅此处的说明 https://github.com/rebilly/Redoc#development

运行 本地开发服务器

  1. 克隆存储库git克隆https://github.com/Rebilly/ReDoc.git
  2. 转到项目文件夹cd ReDoc
  3. 安装依赖项npm install
  4. (可选)将 demo/swagger.yaml 替换为您自己的架构
  5. 启动服务器npm start
  6. 打开http://localhost:9000

或者,Docker 可以仅由 运行 docker 组合使用。