Class Operation
The Operation Object describes a single operation (such as GET, POST, PUT, DELETE) that can be performed on a path. Operations are the core of the API specification, defining what actions can be taken, what parameters they accept, and what responses they return.
OpenAPI Specification:
The Operation Object is composed of the following fields:
- tags (array of string) - A list of tags for API documentation control
- summary (string) - A short summary of what the operation does
- description (string) - A verbose explanation of the operation behavior (CommonMark syntax may be used)
- externalDocs (- ExternalDocumentation) - Additional external documentation for this operation
- operationId (string) - Unique string used to identify the operation
- parameters (array of- Parameter) - A list of parameters that are applicable for this operation
- requestBody (- RequestBodyInfo) - The request body applicable for this operation
- responses (map of- Response, REQUIRED) - The list of possible responses as they are returned from executing this operation
- callbacks (map of- Callback) - A map of possible out-of band callbacks related to the parent operation
- deprecated (boolean) - Declares this operation to be deprecated
- security (array of- SecurityRequirement) - A declaration of which security mechanisms can be used for this operation
- servers (array of- Server) - An alternative server array to service this operation
Example:
   
See Also:
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionaddCallback(String name, Callback callback) Bean property fluent setter:callbacks .addParameters(Collection<Parameter> values) Bean property fluent setter:parameters .addParameters(Parameter... values) Bean property fluent setter:parameters .addResponse(String statusCode, Response response) Bean property fluent setter:responses .addSecurity(Collection<SecurityRequirement> values) Bean property fluent setter:security .addSecurity(SecurityRequirement... values) Bean property fluent setter:security .addServers(Collection<Server> values) Bean property fluent setter:servers .addServers(Server... values) Bean property fluent setter:servers .Bean property appender:tags .addTags(Collection<String> values) Bean property appender:tags .copy()Creates a copy of this object.<T> TGeneric property getter.Returns the callbacks map.Returns the deprecated flag.Returns the description.Returns the external documentation.Returns the operation ID.getParameter(String in, String name) Returns the parameter with the specified type and name.Returns the parameters list.Returns the request body.getResponse(int status) Returns the response with the given status code.getResponse(String status) Returns the response with the given status code.Returns the responses map.Returns the security requirements list.Returns the servers list.Returns the summary.getTags()Returns the tags list.keySet()Returns all the keys on this element.Generic property setter.setCallbacks(Map<String, Callback> value) Sets the callbacks map.setDeprecated(Boolean value) Sets the deprecated flag.setDescription(String value) Sets the description.Sets the external documentation.setOperationId(String value) Sets the operation ID.setParameters(List<Parameter> value) Sets the parameters list.setParameters(Parameter... value) Sets the parameters list.setRequestBody(RequestBodyInfo value) Sets the request body.setResponses(Map<String, Response> value) Sets the responses map.setSecurity(List<SecurityRequirement> value) Sets the security requirements list.setSecurity(SecurityRequirement... value) Sets the security requirements list.setServers(List<Server> value) Sets the servers list.setServers(Server... value) Sets the servers list.setSummary(String value) Sets the summary.Sets the tags list.Sets the tags list.strict()Sets strict mode on this bean.Sets strict mode on this bean.
- 
Constructor Details- 
Operationpublic Operation()Default constructor.
- 
OperationCopy constructor.- Parameters:
- copyFrom- The object to copy.
 
 
- 
- 
Method Details- 
getTagsReturns the tags list.- Returns:
- The tags list.
 
- 
setTagsSets the tags list.- Parameters:
- value- The new value for this property.
- Returns:
- This object.
 
- 
setTagsSets the tags list.- Parameters:
- value- The new value for this property.
- Returns:
- This object.
 
- 
addTagsBean property appender:tags .A list of tags for API documentation control. - Parameters:
- values- The values to add to this property.
 Ignored if- null .
- Returns:
- This object.
 
- 
addTagsBean property appender:tags .A list of tags for API documentation control. - Parameters:
- values- The values to add to this property.
 Ignored if- null .
- Returns:
- This object.
 
- 
addParametersBean property fluent setter:parameters .A list of parameters that are applicable for this operation. - Parameters:
- values- The values to add to this property.
 Ignored if- null .
- Returns:
- This object.
 
- 
addParametersBean property fluent setter:parameters .A list of parameters that are applicable for this operation. - Parameters:
- values- The values to add to this property.
 Ignored if- null .
- Returns:
- This object.
 
- 
addResponseBean property fluent setter:responses .The list of possible responses as they are returned from executing this operation. - Parameters:
- statusCode- The status code for the response.
 Must not be- null .
- response- The response object.
 Must not be- null .
- Returns:
- This object.
 
- 
addCallbackBean property fluent setter:callbacks .A map of possible out-of band callbacks related to the parent operation. - Parameters:
- name- The name of the callback.
 Must not be- null .
- callback- The callback object.
 Must not be- null .
- Returns:
- This object.
 
- 
addSecurityBean property fluent setter:security .A declaration of which security mechanisms can be used for this operation. - Parameters:
- values- The values to add to this property.
 Ignored if- null .
- Returns:
- This object.
 
- 
addSecurityBean property fluent setter:security .A declaration of which security mechanisms can be used for this operation. - Parameters:
- values- The values to add to this property.
 Ignored if- null .
- Returns:
- This object.
 
- 
addServersBean property fluent setter:servers .An alternative server array to service this operation. - Parameters:
- values- The values to add to this property.
 Ignored if- null .
- Returns:
- This object.
 
- 
addServersBean property fluent setter:servers .An alternative server array to service this operation. - Parameters:
- values- The values to add to this property.
 Ignored if- null .
- Returns:
- This object.
 
- 
getSummaryReturns the summary.- Returns:
- The summary.
 
- 
setSummarySets the summary.- Parameters:
- value- The new value for this property.
- Returns:
- This object.
 
- 
getDescriptionReturns the description.- Returns:
- The description.
 
- 
setDescriptionSets the description.- Parameters:
- value- The new value for this property.
- Returns:
- This object.
 
- 
getOperationIdReturns the operation ID.- Returns:
- The operation ID.
 
- 
setOperationIdSets the operation ID.- Parameters:
- value- The new value for this property.
- Returns:
- This object.
 
- 
getExternalDocsReturns the external documentation.- Returns:
- The external documentation.
 
- 
setExternalDocsSets the external documentation.- Parameters:
- value- The new value for this property.
- Returns:
- This object.
 
- 
getParametersReturns the parameters list.- Returns:
- The parameters list.
 
- 
getParameterReturns the parameter with the specified type and name.- Parameters:
- in- The parameter in. Must not be- null .
- name- The parameter name. Must not be- null .
- Returns:
- The matching parameter, or null if not found.
 
- 
setParametersSets the parameters list.- Parameters:
- value- The new value for this property.
- Returns:
- This object.
 
- 
setParametersSets the parameters list.- Parameters:
- value- The new value for this property.
- Returns:
- This object.
 
- 
getRequestBodyReturns the request body.- Returns:
- The request body.
 
- 
setRequestBodySets the request body.- Parameters:
- value- The new value for this property.
- Returns:
- This object.
 
- 
getResponsesReturns the responses map.- Returns:
- The responses map.
 
- 
getResponseReturns the response with the given status code.- Parameters:
- status- The HTTP status code. Must not be- null .
- Returns:
- The response, or null if not found.
 
- 
getResponseReturns the response with the given status code.- Parameters:
- status- The HTTP status code.
- Returns:
- The response, or null if not found.
 
- 
setResponsesSets the responses map.- Parameters:
- value- The new value for this property.
- Returns:
- This object.
 
- 
getCallbacksReturns the callbacks map.- Returns:
- The callbacks map.
 
- 
setCallbacksSets the callbacks map.- Parameters:
- value- The new value for this property.
- Returns:
- This object.
 
- 
getDeprecatedReturns the deprecated flag.- Returns:
- The deprecated flag.
 
- 
setDeprecatedSets the deprecated flag.- Parameters:
- value- The new value for this property.
- Returns:
- This object.
 
- 
getSecurityReturns the security requirements list.- Returns:
- The security requirements list.
 
- 
setSecuritySets the security requirements list.- Parameters:
- value- The new value for this property.
- Returns:
- This object.
 
- 
setSecuritySets the security requirements list.- Parameters:
- value- The new value for this property.
- Returns:
- This object.
 
- 
getServersReturns the servers list.- Returns:
- The servers list.
 
- 
setServersSets the servers list.- Parameters:
- value- The new value for this property.
- Returns:
- This object.
 
- 
setServersSets the servers list.- Parameters:
- value- The new value for this property.
- Returns:
- This object.
 
- 
copyCreates a copy of this object.- Returns:
- A copy of this object.
 
- 
getDescription copied from class:OpenApiElementGeneric property getter.Can be used to retrieve non-standard Swagger fields such as "$ref" .- Overrides:
- getin class- OpenApiElement
- Type Parameters:
- T- The datatype to cast the value to.
- Parameters:
- property- The property name to retrieve.
- type- The datatype to cast the value to.
- Returns:
- The property value, or null if the property does not exist or is not set.
 
- 
setDescription copied from class:OpenApiElementGeneric property setter.Can be used to set non-standard Swagger fields such as "$ref" .- Overrides:
- setin class- OpenApiElement
- Parameters:
- property- The property name to set. Must not be- null .
- value- The new value for the property.
- Returns:
- This object
 
- 
keySetDescription copied from class:OpenApiElementReturns all the keys on this element.- Overrides:
- keySetin class- OpenApiElement
- Returns:
- All the keys on this element.
   
 Nevernull .
 
- 
strictDescription copied from class:OpenApiElementSets strict mode on this bean.- Overrides:
- strictin class- OpenApiElement
- Returns:
- This object
 
- 
strictDescription copied from class:OpenApiElementSets strict mode on this bean.- Overrides:
- strictin class- OpenApiElement
- Parameters:
- value- The new value for this property.
 Non-boolean values will be converted to boolean using- Boolean..- valueOf (value.toString())
 Can be- null (interpreted as- false ).
- Returns:
- This object
 
 
-