public interface Link extends Constructible, Extensible<Link>, Reference<Link>
The Link object represents a possible design-time link for a response. The presence of a link does not guarantee the caller's ability to successfully invoke it, rather it provides a known relationship and traversal mechanism between responses and other operations.
For computing links, and providing instructions to execute them, a runtime expression is used for accessing values in an operation and using them as parameters while invoking the linked operation.
A linked operation MUST be identified using either an operationRef or operationId. In the case of an operationId, it MUST be unique and resolved in the scope of the OAS document. Because of the potential for name clashes, the operationRef syntax is preferred for specifications with external references.
Modifier and Type | Method and Description |
---|---|
Link |
addParameter(java.lang.String name,
java.lang.Object parameter)
Add a new parameter to the parameters property of this instance of Link.
|
default Link |
description(java.lang.String description)
Sets this Link's description property to the given string.
|
java.lang.String |
getDescription()
Returns the description property from a Link instance.
|
java.lang.String |
getOperationId()
Returns the operationId property for this instance of Link.
|
java.lang.String |
getOperationRef()
Returns the operationRef property from a Link instance.
|
java.util.Map<java.lang.String,java.lang.Object> |
getParameters()
Returns the parameters property from this instance of Link.
|
java.lang.Object |
getRequestBody()
Returns the requestBody property from a Link instance.
|
Server |
getServer()
Returns the server property from a Link instance.
|
default Link |
operationId(java.lang.String operationId)
Sets this Link's operationId property to the given string.
|
default Link |
operationRef(java.lang.String operationRef)
Sets this Link's operationRef property to the given string.
|
default Link |
parameters(java.util.Map<java.lang.String,java.lang.Object> parameters)
Sets this Link's parameters property to the given map and returns the modified Link instance.
|
void |
removeParameter(java.lang.String name)
Remove a new parameter to the parameters property of this instance of Link.
|
default Link |
requestBody(java.lang.Object requestBody)
Sets this Link's requestBody property to the given object.
|
default Link |
server(Server server)
Sets this Link's server property to the given object.
|
void |
setDescription(java.lang.String description)
Sets this Link's description property to the given string.
|
void |
setOperationId(java.lang.String operationId)
Sets this Link's operationId property to the given string.
|
void |
setOperationRef(java.lang.String operationRef)
Sets this Link's operationRef property to the given string.
|
void |
setParameters(java.util.Map<java.lang.String,java.lang.Object> parameters)
Sets this Link's parameters property to the given map.
|
void |
setRequestBody(java.lang.Object requestBody)
Sets this Link's requestBody property to the given object.
|
void |
setServer(Server server)
Sets this Link's server property to the given object.
|
addExtension, extensions, getExtensions, removeExtension, setExtensions
Server getServer()
void setServer(Server server)
server
- a server object to be used by the target operationdefault Link server(Server server)
server
- a server object to be used by the target operationjava.lang.String getOperationRef()
void setOperationRef(java.lang.String operationRef)
operationRef
- a relative or absolute reference to an OAS operationdefault Link operationRef(java.lang.String operationRef)
operationRef
- a relative or absolute reference to an OAS operationjava.lang.Object getRequestBody()
void setRequestBody(java.lang.Object requestBody)
requestBody
- a literal value or runtime expression to use as a request body when calling the target operationdefault Link requestBody(java.lang.Object requestBody)
requestBody
- a literal value or runtime expression to use as a request body when calling the target operationjava.lang.String getOperationId()
void setOperationId(java.lang.String operationId)
operationId
- the name of an existing, resolvable OAS operationdefault Link operationId(java.lang.String operationId)
operationId
- the name of an existing, resolvable OAS operationjava.util.Map<java.lang.String,java.lang.Object> getParameters()
void setParameters(java.util.Map<java.lang.String,java.lang.Object> parameters)
parameters
- a map representing parameters to pass to this link's operation as specified with operationId or identified via operationRefdefault Link parameters(java.util.Map<java.lang.String,java.lang.Object> parameters)
parameters
- a map representing parameters to pass to this link's operation as specified with operationId or identified via operationRefLink addParameter(java.lang.String name, java.lang.Object parameter)
name
- The name of the parameter. Can be qualified using the parameter location [{in}.]{name} for operations that use the same parameter
name in different locations (e.g. path.id).parameter
- a constant or an expression to be evaluated at runtime and passed to the linked operation. null values will be rejected
(implementation will throw an exception) or ignored.void removeParameter(java.lang.String name)
name
- The name of the parameter. Can be qualified using the parameter location [{in}.]{name} for operations that use the same parameter
name in different locations (e.g. path.id).java.lang.String getDescription()
void setDescription(java.lang.String description)
description
- a description of the linkdefault Link description(java.lang.String description)
description
- a description of the link