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 |
|---|---|
| public Link | Returns: the current Link instanceThe 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). name, Object 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. parameter)Add a new parameter to the parameters property of this instance of Link. |
| public default Link | Returns: the current Link instancea description of the link description)Sets this Link's description property to the given string. |
| public String | Returns: a description of the linkReturns the description property from a Link instance. |
| public String | Returns: the name of an existing, resolvable OAS operationReturns the operationId property for this instance of Link. |
| public String | Returns: a relative or absolute reference to an OAS operationReturns the operationRef property from a Link instance. |
| public Map | Returns: a copy Map (potentially immutable) representing parameters to pass to this link's operationReturns the parameters property from this instance of Link. |
| public Object | Returns: a literal value or runtime expression to use as a request body when calling the target operationReturns the requestBody property from a Link instance. |
| public Server | Returns: a server object to be used by the target operationReturns the server property from a Link instance. |
| public default Link | Returns: the current Link instancethe name of an existing, resolvable OAS operation operationId)Sets this Link's operationId property to the given string. |
| public default Link | Returns: the current Link instancea relative or absolute reference to an OAS operation operationRef)Sets this Link's operationRef property to the given string. |
| public default Link | Returns: current link instancea map representing parameters to pass to this link's operation as specified with operationId or
identified via operationRef parameters)Sets this Link's parameters property to the given map and returns the modified Link instance. |
| public void | removeParameter(String
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). name)Remove a new parameter to the parameters property of this instance of Link. |
| public default Link | Returns: the current Link instancea literal value or runtime expression to use as a request body when calling the target operation requestBody)Sets this Link's requestBody property to the given object. |
| public default Link | |
| public void | setDescription(String
a description of the link description)Sets this Link's description property to the given string. |
| public void | setOperationId(String
the name of an existing, resolvable OAS operation operationId)Sets this Link's operationId property to the given string. |
| public void | setOperationRef(String
a relative or absolute reference to an OAS operation operationRef)Sets this Link's operationRef property to the given string. |
| public void | setParameters(Map<String, Object>
a map representing parameters to pass to this link's operation as specified with operationId or
identified via operationRef parameters)Sets this Link's parameters property to the given map. |
| public void | setRequestBody(Object
a literal value or runtime expression to use as a request body when calling the target operation requestBody)Sets this Link's requestBody property to the given object. |
| public void |
| addParameter | back to summary |
|---|---|
| public Link addParameter(String name, Object parameter) Add a new parameter to the parameters property of this instance of Link.
| |
| description | back to summary |
|---|---|
| public default Link description(String description) Sets this Link's description property to the given string. | |
| getDescription | back to summary |
|---|---|
| public String getDescription() Returns the description property from a Link instance.
| |
| getOperationId | back to summary |
|---|---|
| public String getOperationId() Returns the operationId property for this instance of Link.
| |
| getOperationRef | back to summary |
|---|---|
| public String getOperationRef() Returns the operationRef property from a Link instance.
| |
| getParameters | back to summary |
|---|---|
| public Map Returns the parameters property from this instance of Link. The key is the parameter name and the value is a constant or a runtime expression to be passed to the linked operation. | |
| getRequestBody | back to summary |
|---|---|
| public Object getRequestBody() Returns the requestBody property from a Link instance.
| |
| getServer | back to summary |
|---|---|
| public Server getServer() Returns the server property from a Link instance.
| |
| operationId | back to summary |
|---|---|
| public default Link operationId(String operationId) Sets this Link's operationId property to the given string. This field is mutually exclusive of the operationRef field. | |
| operationRef | back to summary |
|---|---|
| public default Link operationRef(String operationRef) Sets this Link's operationRef property to the given string. This field is mutually exclusive of the operationId field. | |
| parameters | back to summary |
|---|---|
| public default Link parameters(Map<String, Object> parameters) Sets this Link's parameters property to the given map and returns the modified Link instance. | |
| removeParameter | back to summary |
|---|---|
| public void removeParameter(String name) Remove a new parameter to the parameters property of this instance of Link.
| |
| requestBody | back to summary |
|---|---|
| public default Link requestBody(Object requestBody) Sets this Link's requestBody property to the given object. | |
| server | back to summary |
|---|---|
| public default Link server(Server server) Sets this Link's server property to the given object. | |
| setDescription | back to summary |
|---|---|
| public void setDescription(String description) Sets this Link's description property to the given string.
| |
| setOperationId | back to summary |
|---|---|
| public void setOperationId(String operationId) Sets this Link's operationId property to the given string. This field is mutually exclusive of the operationRef field.
| |
| setOperationRef | back to summary |
|---|---|
| public void setOperationRef(String operationRef) Sets this Link's operationRef property to the given string. This field is mutually exclusive of the operationId field.
| |
| setParameters | back to summary |
|---|---|
| public void setParameters(Map<String, Object> parameters) Sets this Link's parameters property to the given map. | |
| setRequestBody | back to summary |
|---|---|
| public void setRequestBody(Object requestBody) Sets this Link's requestBody property to the given object.
| |
| setServer | back to summary |
|---|---|
| public void setServer(Server server) Sets this Link's server property to the given object.
| |