The OpenAPI Specification and Swagger

The need for standardization when expressing API functionality through either REST or XML endpoints in a platform-, transport-, and programming-language-agnostic way emerged as the OpenAPI Specification in 2015, with major organizations such as Apple, IBM, and Google contributing, lead by a company known as SmartBear. The formal website for this specification is https://www.openapis.org/. The specification states that APIs should be described via a file that contains either YAML (Yet Another Markup Language) or JSON that humans and tools can use to streamline the discovery and consumption of APIs.

At first, this standard was known as the Swagger Specification, though it was later renamed the OpenAPI Specification, or OAS. However, many still refer to the standard as Swagger. The Swagger website (https://swagger.io/) now focuses on tooling around the OpenAPI Specification, which includes ways to author an API specification and generate client- and server-side stubs to help developers consume the resulting API more easily. There is even support for generating Apex client stubs to call APIs described via OpenAPI specifications.

Salesforce has started to adopt this standard through its MuleSoft platform and also through Lightning Platform features such as Lightning External Services, which we will discuss in Chapter 14, Integrating with External Services, in more detail, along with a sample Swagger file.

At the time of writing, there is no officially published OpenAPI specification for Salesforce APIs, nor an automatic way to generate one from your own Apex REST or XML-based APIs, as described in this chapter. However, you can use the tools on the Swagger website to create your own specification files and include them with your product documentation.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
52.14.224.197