In this article we will see How we can add Swagger to an existing WebAPI project.
First why we need swagger here in this case?
Unlike SAOP based web sevrices or WCF Services, WebAPI are RESTFul. That means there is no WSDL in WebAPI. So Unless you prepare proper documentation about the methods, parameters and outputs, its hard to any consumer of the service to interpret them.
This is where swagger comes into the picture. If you use swagger and SwaggerUI in your WebAPI project, it pretty much takes care of the documentation part. It not only gives you the complete details of methods, parameters and outputs of the sevice, but also provides a UI component where consumers can test the service, without any third party tools.