Documenting and testing methods of an ASP.NET Core Web API

Asked

Viewed 135 times

3

Is there any tool capable of listing the methods of a Web API and it is possible to test them?

I have already researched here on the site about this and I did not find specific solutions for a Web API and that meet what I need.

2 answers

1

Yes, there is.

A widely used tool for what you are asking for is Swagger.

What is the Swagger?

Swagger is a project composed of some tools that assist the REST API developer in some tasks such as:

  • Modeling of the API
  • Generating (readable) API documentation
  • Client and Server code generation, with support for multiple programming languages

How to set up?

There is a very interesting article that explains exactly what should be done to set up Swagger for your Web API.

ASP.NET Core: documenting an API with the Swagger framework

Basically what you should do is set up Swagger and then document your Controllers and the object classes of your Web API through comments explaining what each one does.

Done this, Swagger does the magic for you and you can view and test your methods through a generated web page.

-1

Browser other questions tagged

You are not signed in. Login or sign up in order to post.