Swagger is a way of documenting the APIs of a micro service.
Swagger is primarily used for documenting API; now the question arises that why document APIs?
Normally, the developers writes APIs that will be used internal in the enterprise or for the public consumption.
For the other developers to be able to use API, the API must be properly documented; otherwise, how would they know that :-
- What are the endpoints/URLs exposed by the api ?
- What are the operations supported on those endpoints?
- What parameters should they pass, and what will they get back?
- What authentication methods to use?
To answer these questions and the APIs to be consumed properly , it is very important to document the APIs;