What is Swagger?

Swagger is a set of tools that a developer can use to make building APIs simpler, I primarily use swagger to document an API however swagger provides tools that aid you in designing, developing, documenting and testing your API. In this article we’ll be focusing on documenting your API.

Why would you want to use Swagger to document your API?

Swagger uses the OpenAPI specification which is considered to be the world standard for RESTful APIs. The swagger tools were built by the team behind the original specification so you know the tools have been built with that specification in mind.

Why is OpenAPI so good?

OpenAPI is a specification that defines a standard which allows humans and machines to easily understand and discover the capabilities of a service without having access to source code, documentation or network traffic, i’m basically writing what’s written in the OpenAPI specification so you should read more about it here

but in short, if you have a complete OpenAPI specification relating to your API you can generate everything else out of that, so you can generate your documentation and you could even generate your source code from this specification, because OpenAPI is language agnostic you can generate source code in various programming languages, although these things are outside the scope of this article.

#swagger #nodejs #expressjs #api

Start using Swagger in Node.js - The Easiest Way
8.00 GEEK