REST API in minutes
Run the Docker image
docker pull swaggerapi/swagger-editor docker run -d -p 80:8080 swaggerapi/swagger-editor
Navigate to the editor
http://localhost in your browser.
Generate a server
From the top toolbar we can generate server implementations for many languages and frameworks where we can use the code as is or treat as generated boilerplate to merge into our existing code.
mvn spring-boot:runand once running visited
http://localhost:8080/v2and ta-da a REST API in minutes.
Getting ahead of myself
I'll admit the click-bait nature of this article and that while we have an API of the standard example provided by Swagger Editor that it is little but an unimplemented stub.
The power that the OpenAPI specification and Swagger Editor provides is a nice real-time preview of generated Swagger Doc combined with the simplicity of generating server stubs or client library from a wide selection of languages - while elimating the need to create glue code, models or working with annotations within the framework of your choosing - which I feel allows for a rapid workflow and helps us focus on the API definition.