public class OperationObjectBuilder extends Object
Constructor and Description |
---|
OperationObjectBuilder() |
Modifier and Type | Method and Description |
---|---|
OperationObject |
build() |
static OperationObjectBuilder |
operationObject()
Creates a builder for a
OperationObject |
OperationObjectBuilder |
withCallbacks(Map<String,CallbackObject> callbacks) |
OperationObjectBuilder |
withDeprecated(boolean deprecated) |
OperationObjectBuilder |
withDescription(String description) |
OperationObjectBuilder |
withExternalDocs(ExternalDocumentationObject externalDocs) |
OperationObjectBuilder |
withOperationId(String operationId) |
OperationObjectBuilder |
withParameters(List<ParameterObject> parameters) |
OperationObjectBuilder |
withRequestBody(RequestBodyObject requestBody) |
OperationObjectBuilder |
withResponses(ResponsesObject responses) |
OperationObjectBuilder |
withSecurity(List<SecurityRequirementObject> security) |
OperationObjectBuilder |
withServers(List<ServerObject> servers) |
OperationObjectBuilder |
withSummary(String summary) |
OperationObjectBuilder |
withTags(List<String> tags) |
public OperationObjectBuilder withTags(List<String> tags)
tags
- A list of tags for API documentation control. Tags can be used for logical grouping of operations by resources or any other qualifier.public OperationObjectBuilder withSummary(String summary)
summary
- A short summary of what the operation does.public OperationObjectBuilder withDescription(String description)
description
- A verbose explanation of the operation behavior.
CommonMark syntax MAY be used for rich text representation.public OperationObjectBuilder withExternalDocs(ExternalDocumentationObject externalDocs)
externalDocs
- Additional external documentation for this operation.public OperationObjectBuilder withOperationId(String operationId)
operationId
- 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.public OperationObjectBuilder withParameters(List<ParameterObject> parameters)
parameters
- 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.public OperationObjectBuilder withRequestBody(RequestBodyObject requestBody)
requestBody
- The request body applicable for this operation. The requestBody
is only
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,
requestBody
SHALL be ignored by consumers.public OperationObjectBuilder withResponses(ResponsesObject responses)
responses
- REQUIRED. The list of possible responses as they are returned from executing this operation.public OperationObjectBuilder withCallbacks(Map<String,CallbackObject> callbacks)
callbacks
- A map of possible out-of band callbacks related to the parent operation. The key is a unique
identifier for the CallbackObject
. 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.
The key value used to identify the callback object is an expression, evaluated at runtime,
that identifies a URL to use for the callback operation.public OperationObjectBuilder withDeprecated(boolean deprecated)
deprecated
- Declares this operation to be deprecated. Consumers SHOULD refrain from usage of the declared operation. Default value is false
.public OperationObjectBuilder withSecurity(List<SecurityRequirementObject> security)
security
- 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. This definition overrides
any declared top-level security. To remove a top-level security declaration, an empty array
can be used.public OperationObjectBuilder withServers(List<ServerObject> servers)
servers
- An alternative server
array to service this operation. If an alternative
server
object is specified at the Path Item Object or Root level, it will be
overridden by this value.public OperationObject build()
public static OperationObjectBuilder operationObject()
OperationObject
Copyright © 2017–2019. All rights reserved.