ReDoc 是否有类似于 Swagger 编辑器的实时编辑器? [已关闭]

问题描述 投票:0回答:1

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

swagger documentation swagger-editor
1个回答
5
投票

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

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

运行本地开发服务器

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

或者,只需运行 docker-compose up 即可使用 Docker。

© www.soinside.com 2019 - 2024. All rights reserved.