OpenAPI (formerly Swagger) is a language-agnostic, machine-readable specification standard for describing RESTful HTTP APIs. The specification allows both humans and computers to understand API capabilities without accessing source code or documentation through network inspection. OpenAPI descriptions can be written in YAML or JSON format, with YAML preferred for manual authoring due to readability and comment support. OpenAPI 3.1 achieved full JSON Schema Draft 2020-12 compatibility; OpenAPI 3.2 (released September 2025) added first-class streaming support, the QUERY HTTP method, hierarchical tags, and the $self document identity field. The OpenAPI Initiative also maintains two companion standards β the Overlay Specification (non-destructive spec patches) and the Arazzo Specification (API workflow sequences) β completing a three-spec ecosystem for API design, documentation, and orchestration.
What This Cheat Sheet Covers
This topic spans 26 focused tables and 249 indexed concepts. Below is a complete table-by-table outline of this topic, spanning foundational concepts through advanced details.
Table 1: OpenAPI Document Structure
| Field | Example | Description |
|---|---|---|
openapi: 3.1.0 | β’ Required. Specifies the OpenAPI Specification version β 3.0.x, 3.1.x, or 3.2.x are currentβ’ version determines available features and JSON Schema compatibility. | |
info: title: My API version: 1.0.0 | β’ Required. Metadata about the API including title, description, version, contact, license, and terms of service β’ title and version are mandatory. | |
paths: /users: get: {...} | Required (or webhooks or components). Defines available API endpoints and HTTP operations with their parameters, request bodies, and responses. | |
components: schemas: User: {...} | β’ Container for reusable objects β schemas, responses, parameters, examples, security schemes, and more β’ referenced via $ref. | |
servers:- url: https://api.example.com/v1 | β’ Array of server objects defining base URLs where the API is available β’ supports variable substitution for environment-specific URLs. |