I have a REST API developed through the use of Jersey and we document the REST API through swagger-ui. Unfortunately, we did not start versioning the API from day 1. We are
It's pretty straight forward -
1. Add a servlet to set the Swagger Bootstrap properties in your deployment descriptior file.
SwaggerBootstrap
com.example.util.SwaggerBootstrap
URL Pattern Mapping
paramName
uri value
2
2. Create a servlet and set the Bean properties as below --
public void init(ServletConfig servletConfig)
{
try {
// Setting the BeanConfig for start-up page
BeanConfig bean = new BeanConfig();
bean.setScan(true);
bean.setResourcePackage("com.example.util");
bean.setBasePath("yourBasePath"));
bean.setVersion("1.0");
bean.setTitle("title"));
bean.setDescription("description");
} catch (IOException e) {
e.printStackTrace();
}
}