What is Swagger?
On the Swagger site we can find the definition of Swagger:
Swagger is the world’s largest framework of API developer tools for the OpenAPI Specification(OAS), enabling development across the entire API lifecycle, from design and documentation, to test and deployment.
Swagger contains a large ecosystem of tools from which we can single out a set of core tools:
Swagger Editor
Swagger Editor is a tool that allows you to edit Swagger API specification inside your browser. While editing Swagger API specification, the tool will preview the documentation in real time. That way we can immediately see how documentation will look after applying the most recent changes. The editor is easy to use, has a clean user interface and has a lot of features to help you design and document RESTful APIs.
Swagger Codegen
Swagger code generator is a template-driven engine that allows you to generate interactive documentation, API clients and server stubs from Swagger definitions. List of supported languages is quite extensive.
There are the pros and cons of Swagger Codegen:
Pros:
- Generates server code, client code and documentation
- Allows quick changes of the API
- The code generator is open source
Cons:
- Increase in project complexity by using additional tools and libraries
- Generates a lot of code that the user might not understand
Swagger UI
Swagger UI allows anyone to visualize a RESTful API. Visualization is automatically generated from the Swagger specification. So Swagger UI takes an existing JSON or YAML document and creates interactive documentation.
Useful links
https://swagger.io/tools/open-source/getting-started/
https://swagger.io/resources/articles/documenting-apis-with-swagger/
Speed up your RESTful API development in Node.js with Swagger
Swagger editor to allow you to edit your *.yaml files
https://scotch.io/tutorials/speed-up-your-restful-api-development-in-node-js-with-swagger