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.jsonoropenapi.yaml. - Proven The OpenAPI Object requires
openapi(the specification version) andinfo, plus at least one ofpaths,webhooksorcomponents. - Proven Optional top-level fields include
$self,jsonSchemaDialect,servers,security,tagsandexternalDocs; ifserversis missing or empty, the default is a single server with URL/. - Proven The Info Object requires
titleandversion, whereversionis 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,traceandquery, plusadditionalOperations. - Proven An Operation Object can carry an
operationId(case-sensitive and unique across all operations),parameters, arequestBodyandresponses. - Proven A parameter’s
invalue is one ofpath,query,querystring,headerorcookie; path parameters are always required. - Proven The Responses Object MUST contain at least one response code; keys are strings such as
"200", ranges1XXto5XXare allowed, anddefaultcovers undeclared responses.
What goes in components and security?
- Proven The Components Object holds reusable
schemas,responses,parameters,examples,requestBodies,headers,securitySchemes,links,callbacks,pathItemsandmediaTypes; 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
$refURI reference. - Proven A Security Scheme
typeis one ofapiKey,http,mutualTLS,oauth2oropenIdConnect.
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.