Skip to content

api-morph / OperationObject

Interface: OperationObject

Defined in: src/types/openapi.ts:417

Describes a single API operation on a path.

See

https://spec.openapis.org/oas/v3.1.1#operation-object

Indexable

[key: `x-${string}`]: any

This object MAY be extended with Specification Extensions.

Properties

callbacks?

optional callbacks: Record<string, ReferenceObject | CallbackObject>

Defined in: src/types/openapi.ts:472

A map of possible out-of band callbacks related to the parent operation. The key is a unique identifier for the Callback Object. Each value in the map is a Callback Object that describes a request that may be initiated by the API provider and the expected responses.


deprecated?

optional deprecated: boolean

Defined in: src/types/openapi.ts:478

Declares this operation to be deprecated. Consumers SHOULD refrain from usage of the declared operation. Default value is false.


description?

optional description: string

Defined in: src/types/openapi.ts:432

A verbose explanation of the operation behavior. CommonMark syntax MAY be used for rich text representation.


externalDocs?

optional externalDocs: ExternalDocumentationObject

Defined in: src/types/openapi.ts:437

Additional external documentation for this operation.


operationId?

optional operationId: string

Defined in: src/types/openapi.ts:444

Unique string used to identify the operation. The id MUST be unique among all operations described in the API. The operationId value is case-sensitive. Tools and libraries MAY use the operationId to uniquely identify an operation, therefore, it is RECOMMENDED to follow common programming naming conventions.


parameters?

optional parameters: (ReferenceObject | ParameterObject)[]

Defined in: src/types/openapi.ts:452

A list of parameters that are applicable for this operation. If a parameter is already defined at the Path Item, the new definition will override it but can never remove it. The list MUST NOT include duplicated parameters. A unique parameter is defined by a combination of a name and location. The list can use the Reference Object to link to parameters that are defined in the OpenAPI Object's components.parameters.


requestBody?

optional requestBody: ReferenceObject | RequestBodyObject

Defined in: src/types/openapi.ts:460

The request body applicable for this operation. The requestBody is fully supported in HTTP methods where the HTTP 1.1 specification RFC7231 has explicitly defined semantics for request bodies. In other cases where the HTTP spec is vague (such as GET, HEAD and DELETE), requestBody is permitted but does not have well-defined semantics and SHOULD be avoided if possible.


responses

responses: ResponsesObject

Defined in: src/types/openapi.ts:465

The list of possible responses as they are returned from executing this operation.


security?

optional security: SecurityRequirementObject[]

Defined in: src/types/openapi.ts:487

A declaration of which security mechanisms can be used for this operation. The list of values includes alternative Security Requirement Objects that can be used. Only one of the Security Requirement Objects need to be satisfied to authorize a request. To make security optional, an empty security requirement ({}) can be included in the array. This definition overrides any declared top-level security. To remove a top-level security declaration, an empty array can be used.


servers?

optional servers: ServerObject[]

Defined in: src/types/openapi.ts:493

An alternative servers array to service this operation. If a servers array is specified at the Path Item Object or OpenAPI Object level, it will be overridden by this value.


summary?

optional summary: string

Defined in: src/types/openapi.ts:427

A short summary of what the operation does.


tags?

optional tags: string[]

Defined in: src/types/openapi.ts:422

A list of tags for API documentation control. Tags can be used for logical grouping of operations by resources or any other qualifier.

基于 MIT 许可证发布