Setting up a local Swagger instance
You can use a local Swagger instance to review and test new REST APIs.
Use the following instructions to install a local instance of the browser-based, open source Swagger Editor to design document REST APIs created using the Swagger Specification. The editor works alongside the Swagger User Interface, which you also install locally. Pre-built Docker containers are available for both tools, so you can install them easily on any Docker-enabled server.
- Deploying Swagger Editor: To deploy the Swagger editor
container, run the following Docker Commands:
- Pull: docker pull swaggerapi/swagger-editor
- Run: docker run -d -p 5440:8080 swaggerapi/swagger-editor
- To access the swagger editor, navigate to http://localhost:5440/
- Deploying Swagger User Interface: To deploy the Swagger
User Interface container, run the following Docker Commands.
- Pull: docker pull swaggerapi/swagger-ui
- Run: docker run -d -p 5440:8080 swaggerapi/swagger-editor
- To access the Swagger User Interface, navigate to http://localhost:5440/
Ensure that you whitelist the Swagger editor/UI domain by adding it in your CORS configuration.
For more information about using Swagger to view and validate new REST APIs, see Testing REST APIs.