Archi's Academy

GetStarted

GetStarted
Get in touch

API Documentation

Swagger clarifies API development for users and enterprises with the Swagger open-source toolset. Swagger is a specification for describing, producing, consuming, testing and visualizing a RESTful API. The specialty of swagger is its simplicity. It describes how an API works, where it resides, what inputs it needs, and what results it produces.

Several editing tools can help you to create Swagger APIs. Swagger Editor is a tool that can be used to create API documentation. It's an open-source tool that we can download or use online.

Three main sections on the API documentation using swagger editor are:

a. API Declaration

b. Paths

c. Definitions

API declaration

The API declaration part involves defining the Swagger version, BasePath (the root URL that serves the API), and paths section (a list of the APIs exposed). Besides these, we need to add the MIME types (JSON, XML, and XHTML).

Screenshot 2021-03-12 212530.png

Paths

The path involves different operations like GET, POST, HEAD, PUT, PATCH, DELETE, OPTIONS. The parameters are the inputs to these operations which consist of name and type. There are other characteristics also, but they are optional. But remember that adding more information to our API documentation will certainly make it cloudless.

Screenshot 2021-03-12 215510.png

Definitions

The definitions contain a list of data objects. Each data object can have name and properties parameters. Each property has a name and a type.

Screenshot 2021-03-12 225004.png

We can see how it really works on the upcoming week's blogs. Check out here for more information.

Intrigued to know what comes next? Stay tuned at Archi’s Blogs for the next week’s entry!

Surumi-skill-training

Surumi Riju

Friday, Mar 12, 2021