OS2Operation
Usage
import { OS2Operation } from "@tsed/openspec";
See /packages/specs/openspec/src/types/openspec2/OS2Operation.ts.
Overview
interface OS2Operation {
tags?: string[];
summary?: string;
description?: string;
externalDocs?: OpenSpecExternalDocs;
operationId?: string;
consumes?: string[];
produces?: string[];
parameters?: (OS2Parameter | OpenSpecRef)[];
responses: OpenSpecHash<OS2Response | OpenSpecRef>;
schemes?: string[];
deprecated?: boolean;
security?: OpenSpecSecurity;
}
tags
tags?: string[];
A list of tags for API documentation control. Tags can be used for logical grouping of operations by resources or any other qualifier.
summary
summary?: string;
A short summary of what the operation does. For maximum readability in the swagger-ui, this field SHOULD be less than 120 characters.
description
description?: string;
A verbose explanation of the operation behavior. GFM syntax can be used for rich text representation.
externalDocs
externalDocs?: OpenSpecExternalDocs;
Additional external documentation for this operation.
operationId
operationId?: string;
Unique string used to identify the operation. The id MUST be unique among all operations described in the API. Tools and libraries MAY use the operationId to uniquely identify an operation, therefore, it is recommended to follow common programming naming conventions.
consumes
consumes?: string[];
A list of MIME types the operation can consume. This overrides the consumes definition at the Swagger Object. An empty value MAY be used to clear the global definition. Value MUST be as described under Mime Types.
produces
produces?: string[];
A list of MIME types the operation can produce. This overrides the produces definition at the Swagger Object. An empty value MAY be used to clear the global definition. Value MUST be as described under Mime Types.
parameters:
parameters?: (OS2Parameter | OpenSpecRef)[];
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)[https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#parameterIn]. The list can use the Reference Object to link to parameters that are defined at the Swagger Object's parameters. There can be one "body" parameter at most.
responses
responses: OpenSpecHash<OS2Response | OpenSpecRef>;
The list of possible responses as they are returned from executing this operation.
schemes
schemes?: string[];
The transfer protocol of the API. Values MUST be from the list: http
, https
, ws
, wss
. If the schemes is not included, the default scheme to be used is the one used to access the Swagger definition itself.
deprecated
deprecated?: boolean;
Declares this operation to be deprecated. Usage of the declared operation should be refrained. Default value is false.
security
security?: OpenSpecSecurity;
A declaration of which security schemes are applied for this operation. The list of values describes alternative security schemes that can be used (that is, there is a logical OR between the security requirements). This definition overrides any declared top-level security. To remove a top-level security declaration, an empty array can be used.