What is swagger api?
Swagger is a specification for documenting REST API. It specifies the format (URL, method, and representation) to describe REST web services. It provides also tools to generate/compute the documentation from application code.
The goal of Swagger is to define a standard, language-agnostic interface to REST APIs which allows both humans and computers to discover and understand the capabilities of the service without access to source code, documentation, or through network traffic inspection. When properly defined via Swagger, a consumer can understand and interact with the remote service with a minimal amount of implementation logic. Similar to what interfaces have done for lower-level programming, Swagger removes the guesswork in calling the service.
Installation of swagger
1.Download swagger from github here link is https://github.com/swagger-api/swagger-ui
2.Run the below command to install swagger ui tool
npm install -- save swagger-ui-dist
3.After completion of installation,we get node_modules folder.
4.In that copy swagger-ui-dist folder to outside.
5.Now run into browser like
localhost/swagger-ui-dist
6.Get ui tool on browser.
7.Now customize tool with your api calls.
8.swagger-ui-dist folder contains index.html
9.Change url location in javascript ,link your json or yaml file.