What is SWAGGER UI?
Swagger UI is an HTML/CSS/JS framework that provides interactive documentation of your RESTful APIs and generates a navigable UI of the documentation. Swagger UI provides automatically generated HTML assets that give you automatic documentation and even an online test tool.It is extremely easy to set up, and comes with a lot of configurable options like XML Documentation, various kinds of Authentications (Basic, OAUTH2, API key), etc. which can be configured depending on the security schemes set up in your APIs.
This can reduce the time and efforts you spend on creating your Client Application to consume and test your RESTful APIs. With minimum amount of code, you will get an easy to use test client for your APIs.
Benefits of using SWAGGER UI?
- A Sandbox!
- Create test client for your APIs in seconds!
- It's comprehensible for developers and non-developers.
- It's easily adjustable.
- It’s like a sitemap for your API.
How to set Up the Swagger UI in your WEB APIs?
- Install the Swagger Nuget Package in your API project. This will add the Swashbuckle.Core.dll assembly to your project, and other required files that Swagger UI might need.
- Run your API project, and append “/Swagger” to the default API URL.
- This will open the Swagger UI page which will have a list of all your API controllers, and their respective methods.
- You can hit the “Try it out!” button to test the API method. This will fire that API method, and will list out the Response URL, Response Body, Response Headers in the same section as displayed below:
- Please note that if you try to test the Authenticated API method without providing proper authentication, it will return Unauthorized Response Code (401), along with the error message as shown in image below:
- If you still want to go ahead and consume Swagger to authenticate and test your protected APIs, all you need to do is to configure the SwaggerConfig.cs file provided by Swagger. That’s it!!
https://blogs.msdn.microsoft.com/pratushb/2016/04/28/enable-swagger-to-authenticate-against-azure-ad/
This is an awesome blog for this technology really well researched content
ReplyDeleteand excellent wording. Thanks for posting this information.
dot net training in chennai
dot net course in chennai
Advanced excel training in chennai
android training in chennai
corporate training in chennai
dot net training in porur
dot net training in adyar
Accord IT Training is providing Best Java Training Institute in Chennai with placement.
ReplyDeletefor any queries
contact on +91 9940289059
#Java Institute
#Java Training in chennai
#Core Java Training in Chennai
Great blog, I was searching this for a while. Do post more like this.
ReplyDeleteAzure Training in Chennai
Microsoft Azure Training in Chennai
Cloud Computing Training in Chennai
VMware Training in Chennai
AWS Training in Chennai
DevOps Training in Chennai
Cloud computing Training in Chennai
Cloud Computing Courses in Chennai
I simply wanted to write down a quick word to say thanks to you for those wonderful tips and hints you are showing on this site.
ReplyDeletedot net training in chennai | dot net training institute in chennai | dot net course in chennai | .NET Training Center in Chennai
| Best .NET Course in Chennai with placements
Appreciating the persistence you put into your blog and detailed information you provide.Thanks for your blog
ReplyDeleteAzure training chennai | Azure training course chennai
ReplyDeleteIt’s great to come across a blog every once in a while that isn’t the same out of date rehashed material. Fantastic read.
UIpath training in chennai | uipath training class chennai
You got a really useful blog here. I gained more knowledge regarding azure cloud migration services. I got amazing information from this blog.
ReplyDeleteazure cloud migration services
Information shared above is highly appreciated. I found the blog very informative. Your article has inspired many of us to learn this. You have shared your deep knowledge on Swagger. Recently i came to know MaxMunus offers the best Swagger training across the globe. If you come across anyone looking for training, you can ask him to contact them directly. They are reachable at:-
ReplyDeleteSwagger Training