Utilumo
LightDarkSystem

Updated August 26, 2026

OpenAPI document structure reference

An OpenAPI document describes a REST API as a single JSON or YAML file. This sheet lists the root fields, the shape of a path operation, and the common HTTP methods so you can read or write a spec quickly.

Root fields

FieldRequiredPurpose
openapiYesSpec version string, e.g. 3.1.0
infoYesAPI title, version, and description
serversNoBase URLs the API is served from
pathsYesEndpoints, each with methods and operations
componentsNoReusable schemas, parameters, responses, security schemes
securityNoAuthentication applied to operations
tagsNoGrouping labels for operations in docs

Fields inside a path operation

FieldPurpose
summaryShort label for the operation
operationIdUnique name used by code generators
parametersPath, query, header, and cookie inputs
requestBodyPayload schema and media types
responsesStatus codes mapped to response schemas
securityAuth required for this operation

Common HTTP methods in paths

MethodTypical use
getRead a resource; no request body
postCreate a resource or run an action
putReplace a resource entirely
patchUpdate part of a resource
deleteRemove a resource
Swagger vs OpenAPISwagger 2.0 is the older format and uses a swagger: "2.0" field. OpenAPI 3.x replaces it with openapi: and moves reusable pieces under components. Most tools read both, but the field names differ.
Specs can be sensitiveAn OpenAPI document can expose internal endpoints, parameters, and auth schemes. Inspect it in a local, browser-only viewer so the spec is not uploaded to a third-party service.

References

Questions

Which OpenAPI fields are required?

openapi, info, and paths are required in OpenAPI 3.x. servers, components, security, and tags are optional but common.

Where do reusable schemas live?

Under components — for example components/schemas for data models and components/securitySchemes for auth. Operations reference them with $ref.