How can I document my API with Swagger?

Swagger has provided a very simple way to document your APIs.

I created a simple OOTB Web Application with the Web API template. To create the swagger output:

1. Add the SwashBuckle nuget package



2. Publish the API and navigate to <API URL>/swagger/docs/v1. This will create the swagger json


3. Save the file in a swagger.json file in the solution.
4. Open the file with the http://editor.swagger.io/#/ to retrieve the documentation.




Comments

Popular posts from this blog

SharePoint 2013: Error updating managed account credentials

How can I call a JIRA api through Powershell?