The OpenAPI 3.1 Operation Object
In an OpenAPI document, each HTTP method under a path is an Operation Object. It bundles the parameters, request body, possible responses and metadata for one call. This reference lists every field of the 3.1 Operation Object with its JSON type and requirement, plus a live search.
How it works
An Operation sits inside a Path Item, keyed by the lowercase method name:
paths:
/pets/{id}:
get:
operationId: getPet
tags: [pets]
parameters:
- name: id
in: path
required: true
schema: { type: string }
responses:
"200":
description: A pet
Only the responses field is required. The parameters array is merged with
any path-level parameters; requestBody replaces the older body parameter from
Swagger 2.0; and callbacks define out-of-band webhooks the API may send.
Tips and notes
- Set
deprecated: trueto flag an operation for removal without deleting it. - Give every operation a unique
operationIdso generators produce clean names. - An operation-level
securityarray overrides the document-level default. serverson an operation overrides the path and root server lists.