Diary

Running Swagger Editor Locally with Docker

1 Mins read

swagger

A tool you can use for API design document management. It generates sample code as JSON, and behaves like Postman for testing.

More and more projects are using it lately.

Starting a local server (example with 3 instances, useful when you have 3 external API servers, etc.)

docker pull swaggerapi/swagger-editor
docker run -d -p 8090:8080 swaggerapi/swagger-editor
docker run -d -p 8091:8080 swaggerapi/swagger-editor
docker run -d -p 8092:8080 swaggerapi/swagger-editor

Open http://localhost:8090 etc. in your browser

Copy and paste the yaml file content from your repository into the left window of the browser alongside your source control

Test with get, post, etc.

※You’ll need some understanding of API specifications

Often used together with OpenAPI

This tool reads yaml files in API design format and automatically generates I/O source code in your specified language. However, it’s not all roses—it sometimes generates incorrect code, so you’ll often run into situations where you need to do some debugging and cleanup.