OpenAPI vs Swagger






Most of the people think Swagger and openAPI is same. But, it is not.
Then what are those.

It is true that, until 2015, openAPI specification is called as Swagger specification. But, in 2015, SmartBear donated the fostering of openAPI to openAPI initiatives. Hence, since 2015, this specification was renamed to the OpenAPI specification. 

Then let me explain the difference between openAPI and Swagger.

What is OpenAPI?

OpenAPI is a standard specification which can be used to describe your REST API including,
  • All the endpoints defined in your Rest API   
  • Operations defined on each endpoint
  • Operation parameters (input and output parameters)
  • Request bodies
  • Response bodies
  • Authentication Methods (Basic, OpenID)
  • License Information, terms of use
This openAPI specification can be written in both YAML and JSON.

These specifications can be understood by both human and computers  and it allows them to understand the capabilities of your REST API without observing the source codes and other documentation.

OpenAPI GitHub - https://github.com/OAI/OpenAPI-Specification

What is Swagger?

Swagger provides open source tools those can be used to implement the openAPI specifications.
Mainly, swagger has three type of tools.

Swagger editor -  This is browser based editor and this can be used to write/edit openAPI specifications in YAML format.

Swagger UI – It renders openAPI specifications and generates nice documentation. By installing Swagger UI in same domain that your endpoints are located, you can interact with your REST API through swagger UI. (Ex: You can send Requests to REST end points through the Swagger UI)
Swagger Codegen – This allows you to implement server stubs to generate openAPI specifications for given REST APIs.

Swagger GitHub - https://github.com/swagger-api 

OpenAPI Implementation is raised by OpenAPI Initiatives. Most popular organizations in the IT world involve for this. Ex: IBM, Microsoft, Google, etc. Swagger Implementations are lead by Smartbear which is also involving for openAPI initiatives.

Latest version of the openAPI is openAPi 3.0 and Swagger 2.0 supports for implementation of it. Swagger version 1.5 can be used for implementation of openAPI version 2.

Even though, Swagger is the most commonly used tools to implement openAPI specifications, there are variety of  other tools those support for implementation of OpenAPI specifications. https://github.com/OAI/OpenAPI-Specification/blob/master/IMPLEMENTATIONS.md
Hence, Swagger is not the one and only tool can be used for implementations of openAPI specifications.

The common thing of Swagger and openAPI is both of them have open source communities, so anyone can join to those communities and contribute the evolvement of openAPi specifications or Swagger.





Comments

Post a Comment

Popular posts from this blog

How to add standard and custom Metadata to PDF using iTextSharp

How to set and get Metadata to image using BitmapMetadata class in C#

How to generate direct line token to start a new conversation between your own client application and bot framework in Java