The OpenAPI Specification Explained
The OpenAPI Specification is the ultimate source of knowledge regarding this API description format. However, its length is daunting to newcomers and makes it hard for experienced users to find specific bits of information. This chapter provides a soft landing for readers not yet familiar with OpenAPI and is organized by topic, simplifying browsing.
The following pages introduce the syntax and structure of an OpenAPI Description (OAD), its main building blocks, and a minimal API description. The different blocks are then detailed, starting from the most common and progressing towards advanced ones.
- Structure of an OpenAPI Description: JSON, YAML,
openapi, andinfo. - API Endpoints:
pathsandresponses. - HTTP Methods: standard and custom HTTP methods.
- Content of Message Bodies:
contentandschema. - Parameters and Payload of an Operation:
parametersandrequestBody. - Reusing Descriptions:
componentsand$ref. - Providing Documentation and Examples:
summary,descriptionandexample/examples. - API Servers:
servers. - Describing API Security:
securitySchemesandsecurity. - Enhanced Tags:
tags. - Providing Callbacks:
callbacks. - Providing Webhooks:
webhooks. - Implementing Links:
links. - Sequential Media Types:
itemSchemaand streaming media types.