Open API 2.0 Schema and Swagger Tools
In this blog, I am going to walk you through another awesome topic – ‘Exploring Open API 2.0 Schema and Swagger Tool ‘ and how Open API can be used in Salesforce External Services.
What is the Open API Schema?
Just like we have WSDL for SOAP API, OpenAPI Specification (formerly called as Swagger Specification) is an API description format for REST APIs.Open API is a set of rules (in other words, a specification) for a format describing REST APIs. It has become a de-facto standard for designing and describing RESTful APIs and is used by millions of developers and organizations for developing their APIs, be it internal or client-facing.
The format is both machine-readable and human-readable. It can be used to share documentation among various stakeholders in the project lifecycle and can also be used by various tools to automate an API-related process.
Exploring Open API Schema:
Here is a self-explanatory template of taking an example of an Open API Schema:
Reference: Basic Structure of Open API 2.0 Schema
The above structure is very well explained in this article, so please go through it to understand the basic structure for Open API 2.0 Schema.
Why write Open API Schema?
Since Open API Schema is pretty new, there are many products/tools/Softwares that don’t have an Open API Schema handy soo, in that case, it becomes important to understand their API and create a schema based on it in the above structure/format.
Difference between Open API Schema and Swagger Tools
In the beginning, I was slightly confused with the difference between Open API and Swagger so I thought to share it.The OpenAPI is the official name of the specification. Open API Development is fostered by the OpenAPI Initiative,
which involves more the 30 organizations from different areas of the tech world including Microsoft, Google, and IBM,
Smartbear Software, which is also a member of the OpenAPI Initiative, is the company that leads to the development of the Swagger tools, helping lead the evolution of the specification.
If you want to try out writing an Open API, I would recommend using Swagger Editor. I have personally used it and love it because it automatically checks out the syntax and compiles the Schema automatically. Check out other swagger tools here .
How is it used in Salesforce?
External Services in Salesforce supports Interagent hyper-schema using JSON and Swagger Open API 2.0. Swagger Open API 2.0 is used External Services which automates an API related process. You can find a great article on trailhead –How you can define a Schema for an External Service.
I hope you have now an idea about Open API 2.0 and Swagger Tool plus how it is important for Salesforce use. I will be using this blog as a reference for one of my future blog on – Writing a Swagger API 2.0 for Graph API and using it in External service