This is going to focus REST API documentation with Swagger. We know that REST APIs are very popular with modern world technology and most of the technology solutions came up with REST Implementations. Developers who are involved with the REST APIs development and they have kind of problem like how to document the REST APIs and how to simply expose those REST APIs to the end users. Swagger is good solution for above explained problem. So lets talk about swagger integration to the JAX-RS API. I think that you are familiar with the JAVA JAX-RS implementations. If not you have to get some knowledge about JAX-RS implementation.
1. You have to add swagger maven artifact to your project.
2. Secondly you have to mentioned the base path on your web.xml. This URL will be used as backend service call from swagger-ui
3. Finally you have to annotate your REST-APIs by swagger annotations. You can get total idea from following code snippets.
4. Then you have to get the swagger-ui and host it on your local tomcat.
5. Now you can simply view and invoke the REST APIs which is developed by you by using the Swagger UI.