Swagger is the world's most popular framework for APIs.
[Swagger] (http://swagger.io/)
Install plugin on Intellij.
Under Intellij Preferences
->Plugin
->Browse repositories...
Search keyword : Swagger
Install it and restart Intellij.
[Swagger RESTEasy] (https://github.com/swagger-api/swagger-core/wiki/Swagger-Core-RESTEasy-2.X-Project-Setup-1.5#adding-the-dependencies-to-your-application)
- Add dependency on
pom.xml
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-jaxrs</artifactId>
<version>1.5.0</version>
</dependency>
- Add configuration on Application
//add class for swagger
this.classes.add(io.swagger.jaxrs.listing.ApiListingResource.class);
this.classes.add(io.swagger.jaxrs.listing.SwaggerSerializers.class);
//add config for swagger
BeanConfig beanConfig = new BeanConfig();
beanConfig.setTitle("Migme Backend API Explorer");
beanConfig.setDescription("Migme Backend API Explorer");
beanConfig.setVersion("1.0.0");
beanConfig.setSchemes(new String[]{"http"});
beanConfig.setHost("localhost:8080");
beanConfig.setBasePath("/");
beanConfig.setResourcePackage("com.projectgoth.migbo.datasvc.service");
beanConfig.setScan(true);
beanConfig.setPrettyPrint(true);
- Add
@Api
on each REST class
@Api(value = "/test", description = "Operations about tests")
Find out json from the url :
http://localhost:8080/{path}/swagger.json