What an OpenAPI description contains

An OpenAPI Description is a JSON or YAML document set that formally describes an HTTP API: its paths, operations, parameters, responses, reusable schemas and security schemes. The format is defined by the OpenAPI Specification, maintained by the OpenAPI Initiative; this page follows version 3.2.1.

Verified against the sources on 2026-11-25. Labels: Proven means the primary source we opened states it. Practice means widely used practice or secondary reporting the primary source does not confirm. Experimental means a proposal or draft.

What are the OpenAPI Specification and an OpenAPI Description?

  • Proven The specification describes itself as a language-agnostic interface description for HTTP APIs, so people and machines can understand a service without its source code.
  • Proven An OpenAPI Description (OAD) is the document or document set that describes an API; tools can use it for documentation, code generation and testing.
  • Proven The OpenAPI Initiative learning site says OpenAPI was originally based on Swagger 2.0, donated by SmartBear Software in 2015, and is now maintained by the OpenAPI Initiative, a Linux Foundation consortium.
  • Proven The same site lists uses such as generating reference documentation, generating client and server code, validating data, and creating mock servers from examples.

How is an OpenAPI Description structured?

  • Proven An OAD can be one document or several connected by URI references; each document has an OpenAPI Object or a Schema Object at its root.
  • Proven Documents can be JSON or YAML, and the specification recommends naming the entry document openapi.json or openapi.yaml.
  • Proven The OpenAPI Object requires openapi (the specification version) and info, plus at least one of paths, webhooks or components.
  • Proven Optional top-level fields include $self, jsonSchemaDialect, servers, security, tags and externalDocs; if servers is missing or empty, the default is a single server with URL /.
  • Proven The Info Object requires title and version, where version is the version of the API document, not of the specification.

How are endpoints and operations described?

  • Proven The Paths Object maps path templates beginning with /, such as /pets/{petId}, to Path Item Objects.
  • Proven A Path Item holds operations under HTTP method fields: get, put, post, delete, options, head, patch, trace and query, plus additionalOperations.
  • Proven An Operation Object can carry an operationId (case-sensitive and unique across all operations), parameters, a requestBody and responses.
  • Proven A parameter’s in value is one of path, query, querystring, header or cookie; path parameters are always required.
  • Proven The Responses Object MUST contain at least one response code; keys are strings such as "200", ranges 1XX to 5XX are allowed, and default covers undeclared responses.

What goes in components and security?

  • Proven The Components Object holds reusable schemas, responses, parameters, examples, requestBodies, headers, securitySchemes, links, callbacks, pathItems and mediaTypes; they have no effect unless referenced.
  • Proven Schema Objects are based on JSON Schema Draft 2020-12.
  • Proven A Reference Object points to another component with a $ref URI reference.
  • Proven A Security Scheme type is one of apiKey, http, mutualTLS, oauth2 or openIdConnect.

What this page does not cover

  • Every field and object in the specification; this is an overview of the main structure only.
  • Differences from earlier versions such as 3.0 and 3.1.
  • Which tools or AI agents read OpenAPI Descriptions; the pages we opened do not name them.

Sources

  1. OpenAPI Specification v3.2.1
  2. OpenAPI Initiative: Introduction (learn.openapis.org)

Related guides