Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between swagger-api and JAX-RS?

Tags:

jax-rs

swagger

What is the difference between swagger-api and JAX-RS ?

Is the swagger-api only for documentation? (for example @ApiOperation)

like image 242
user1365697 Avatar asked Jan 06 '23 03:01

user1365697


2 Answers

As per the API docs, JAX-RS is the Java API for RESTful Web Services that provides portable APIs for developing, exposing and accessing Web applications designed and implemented in compliance with principles of REST architectural style.

Swagger, on the other hand, comes in picture when you have implemented your restful web services using any of the JAX-RS implementations (Jersey, RestEasy, Apache-CXF, etc as already mentioned by @Bijoy). Swagger adds form to your APIs by making them look good and presentable so that client code can be written easily, at the same time it also makes documentation a much less boring task by integrating it with code. Needless to say, also saves the extra time it takes to document if done after coding is over. In this sense, it is a bit revolutionary.

like image 127
Sampada Avatar answered Jan 22 '23 05:01

Sampada


jax-rs is REST specification, and it is implemented by ones like jersey, resteasy etc, swagger is more on documenting and it has an easy interface if you want to test and make lot easier from different platform for adapt your rest functionalities

like image 39
Bijoy Avatar answered Jan 22 '23 07:01

Bijoy