Skip to main content

Posts

Showing posts from November, 2016

How to disable Swagger documentation?

Background   When I was developing foundational RESTful APIs (Web API) for one of our clients, swagger was our choice for documentation. Swagger provides interactive documentation feature with nice UI. Since we were developing only RESTful APIs, QA team members were using Swagger UI to test APIs. Suddenly there was a request from customer to disable swagger in production environment. Solution How to enable swagger? Install "Swashbuckle" nuget package into your WebAPI project.  This installation will add the following entries in "packages.config"   <package id=" Swashbuckle " version="5.5.3" targetFramework="net45" />   <package id=" Swashbuckle.Core " version="5.5.3" targetFramework="net45" /> " SwaggerConfig.cs " file will be added in " App_Start " folder Execute the project code. When the new browser window pops out, add " swagger/ui/