OpenAPI, previously known as Swagger Specification, is a specification language for HTTP APIs that defines a consistent means to carry information through each stage of the API lifecycle. It is a machine-readable interface definition language for describing, producing, consuming, and visualizing web services. OpenAPI is programming-language agnostic, which means that clients can understand and consume services without knowledge of server implementation or access to the server code.
OpenAPI allows users to describe their entire API, including the HTTP methods, parameters, request/response body, and authentication methods, in a JSON or YAML document. This document serves as the single source of truth for the API and can be used to generate client code, configure infrastructure, and create test cases for the API. OpenAPI is distinct from other API description formats in that it provides a comprehensive dictionary of terms that reflects commonly-understood concepts in the world of APIs, embedding the fundamentals of HTTP and JSON.
The OpenAPI Specification is versioned using a major.minor.patch versioning scheme, and the latest version as of November 2023 is 3.1.0. The major.minor portion of the version string designates the OAS feature set, while the patch versions address errors in or provide clarifications to the document, not the feature set.
OpenAPI is widely used in the industry and is supported by many companies, including Microsoft and Google. It enables engineers to plan and design servers, generate code, and implement contract testing, while other internal teams can aggregate these API definitions to determine their API program’s footprint and dependencies. OpenAPI technology allows businesses in various industries to build reliable, adaptable, user-friendly APIs for clients and interact easily with remote services using minimal implementation logic.