Top Description Methods
org.eclipse.microprofile.openapi.models.links

public Interface Link

extends Constructible, Extensible<Link>, Reference<Link>
Imports
java.util.Map, org.eclipse.microprofile.openapi.models.Constructible, .Extensible, .Reference, org.eclipse.microprofile.openapi.models.servers.Server

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.

See Also
OpenAPI Specification Link Object

Method Summary

Modifier and TypeMethod and Description
public Link

Returns:

the current Link instance
addParameter
(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
,
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 instance
description
(String
a description of the link
description
)

Sets this Link's description property to the given string.

public String

Returns:

a description of the link
getDescription
()

Returns the description property from a Link instance.

public String

Returns:

the name of an existing, resolvable OAS operation
getOperationId
()

Returns the operationId property for this instance of Link.

public String

Returns:

a relative or absolute reference to an OAS operation
getOperationRef
()

Returns the operationRef property from a Link instance.

public Map<String, Object>

Returns:

a copy Map (potentially immutable) representing parameters to pass to this link's operation
getParameters
()

Returns 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 operation
getRequestBody
()

Returns the requestBody property from a Link instance.

public Server

Returns:

a server object to be used by the target operation
getServer
()

Returns the server property from a Link instance.

public default Link

Returns:

the current Link instance
operationId
(String
the 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 instance
operationRef
(String
a 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 instance
parameters
(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 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 instance
requestBody
(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 default Link

Returns:

the current Link instance
server
(Server
a server object to be used by the target operation
server
)

Sets this Link's server property to the given object.

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
setServer(Server
a server object to be used by the target operation
server
)

Sets this Link's server property to the given object.

Inherited from org.eclipse.microprofile.openapi.models.Extensible:
addExtensionextensionsgetExtensionsremoveExtensionsetExtensions
Inherited from org.eclipse.microprofile.openapi.models.Reference:
getRefrefsetRef

Method Detail

addParameterback to summary
public Link addParameter(String name, Object parameter)

Add a new parameter to the parameters property of this instance of Link.

Parameters
name: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).

parameter: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.

Returns:Link

the current Link instance

descriptionback to summary
public default Link description(String description)

Sets this Link's description property to the given string.

Parameters
description:String

a description of the link

Returns:Link

the current Link instance

getDescriptionback to summary
public String getDescription()

Returns the description property from a Link instance.

Returns:String

a description of the link

getOperationIdback to summary
public String getOperationId()

Returns the operationId property for this instance of Link.

Returns:String

the name of an existing, resolvable OAS operation

getOperationRefback to summary
public String getOperationRef()

Returns the operationRef property from a Link instance.

Returns:String

a relative or absolute reference to an OAS operation

getParametersback to summary
public Map<String, Object> getParameters()

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.

Returns:Map<String, Object>

a copy Map (potentially immutable) representing parameters to pass to this link's operation

getRequestBodyback to summary
public Object getRequestBody()

Returns the requestBody property from a Link instance.

Returns:Object

a literal value or runtime expression to use as a request body when calling the target operation

getServerback to summary
public Server getServer()

Returns the server property from a Link instance.

Returns:Server

a server object to be used by the target operation

operationIdback 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.

Parameters
operationId:String

the name of an existing, resolvable OAS operation

Returns:Link

the current Link instance

operationRefback 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
operationRef:String

a relative or absolute reference to an OAS operation

Returns:Link

the current Link instance

parametersback 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.

Parameters
parameters:Map<String, Object>

a map representing parameters to pass to this link's operation as specified with operationId or identified via operationRef

Returns:Link

current link instance

removeParameterback to summary
public void removeParameter(String name)

Remove a new parameter to the parameters property of this instance of Link.

Parameters
name: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).

requestBodyback to summary
public default Link requestBody(Object requestBody)

Sets this Link's requestBody property to the given object.

Parameters
requestBody:Object

a literal value or runtime expression to use as a request body when calling the target operation

Returns:Link

the current Link instance

serverback to summary
public default Link server(Server server)

Sets this Link's server property to the given object.

Parameters
server:Server

a server object to be used by the target operation

Returns:Link

the current Link instance

setDescriptionback to summary
public void setDescription(String description)

Sets this Link's description property to the given string.

Parameters
description:String

a description of the link

setOperationIdback 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.

Parameters
operationId:String

the name of an existing, resolvable OAS operation

setOperationRefback 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.

Parameters
operationRef:String

a relative or absolute reference to an OAS operation

setParametersback to summary
public void setParameters(Map<String, Object> parameters)

Sets this Link's parameters property to the given map.

Parameters
parameters:Map<String, Object>

a map representing parameters to pass to this link's operation as specified with operationId or identified via operationRef

setRequestBodyback to summary
public void setRequestBody(Object requestBody)

Sets this Link's requestBody property to the given object.

Parameters
requestBody:Object

a literal value or runtime expression to use as a request body when calling the target operation

setServerback to summary
public void setServer(Server server)

Sets this Link's server property to the given object.

Parameters
server:Server

a server object to be used by the target operation