Search code examples
swaggerdocumentationswagger-editor

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


I've started using ReDoc to publish my documentation but don't have a good way to know what it will look like before pushing it to my web server. I've used http://editor.swagger.io/ in the past and found it pretty useful. Is there anything like that for ReDoc?


Solution

  • Yes, if you use this project: https://github.com/Rebilly/generator-openapi-repo#features

    You can use the swagger editor with it. It doesn't render a preview of ReDoc, but you can have a local dev environment running and watch that browser window reload. To start a local dev environment, see instructions from here https://github.com/rebilly/Redoc#development

    Running local dev-server

    1. Clone repository git clone https://github.com/Rebilly/ReDoc.git
    2. Go to the project folder cd ReDoc
    3. Install dependencies npm install
    4. (optional) Replace demo/swagger.yaml with your own schema
    5. Start the server npm start
    6. Open http://localhost:9000

    Alternatively, Docker can be used by just running docker-compose up.