gradle appRun
Then click on the Show/Hide
of the default
api group, and you can even try to invoke it with custom parameters.
There are actually 3 kinds of url to make the total:
- API by
jersey
: http://localhost:8080/swagger-ui-demo/api/hello/freewind - swagger.json by
swagger-jersey2-jaxrs
: http://localhost:8080/swagger-ui-demo/api/swagger.json - Swagger-UI by
org.webjars:swagger-ui
: http://localhost:8080/swagger-ui-demo/webjars/swagger-ui/2.1.4/
Swagger-UI is actually a static web application using AJAX to provide all functionalities. But to make it easier in a Java application, we use the webjar
version.
The swagger-ui has the default api url of http://petstore.swagger.io/v2/swagger.json, but we can pass our own url to it by appending ?url=my-url
.
https://github.com/swagger-api/swagger-core/wiki/Swagger-Core-Jersey-2.X-Project-Setup-1.5