All Superinterfaces:
Constructible, Extensible<Link>, Reference<Link>

public interface Link extends Constructible, Extensible<Link>, Reference<Link>
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:
  • Method Details

    • getServer

      Server getServer()
      Returns the server property from a Link instance.
      Returns:
      a server object to be used by the target operation
    • setServer

      void setServer(Server server)
      Sets this Link's server property to the given object.
      Parameters:
      server - a server object to be used by the target operation
    • server

      default Link server(Server server)
      Sets this Link's server property to the given object.
      Parameters:
      server - a server object to be used by the target operation
      Returns:
      the current Link instance
    • getOperationRef

      String getOperationRef()
      Returns the operationRef property from a Link instance.
      Returns:
      a relative or absolute reference to an OAS operation
    • setOperationRef

      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 - a relative or absolute reference to an OAS operation
    • operationRef

      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 - a relative or absolute reference to an OAS operation
      Returns:
      the current Link instance
    • getRequestBody

      Object getRequestBody()
      Returns the requestBody property from a Link instance.
      Returns:
      a literal value or runtime expression to use as a request body when calling the target operation
    • setRequestBody

      void setRequestBody(Object requestBody)
      Sets this Link's requestBody property to the given object.
      Parameters:
      requestBody - a literal value or runtime expression to use as a request body when calling the target operation
    • requestBody

      default Link requestBody(Object requestBody)
      Sets this Link's requestBody property to the given object.
      Parameters:
      requestBody - a literal value or runtime expression to use as a request body when calling the target operation
      Returns:
      the current Link instance
    • getOperationId

      String getOperationId()
      Returns the operationId property for this instance of Link.
      Returns:
      the name of an existing, resolvable OAS operation
    • setOperationId

      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 - the name of an existing, resolvable OAS operation
    • operationId

      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 - the name of an existing, resolvable OAS operation
      Returns:
      the current Link instance
    • getParameters

      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:
      a map representing parameters to pass to this link's operation
    • setParameters

      void setParameters(Map<String,Object> parameters)
      Sets this Link's parameters property to the given map.
      Parameters:
      parameters - a map representing parameters to pass to this link's operation as specified with operationId or identified via operationRef
    • parameters

      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 - a map representing parameters to pass to this link's operation as specified with operationId or identified via operationRef
      Returns:
      current link instance
    • addParameter

      Link addParameter(String name, Object parameter)
      Add a new parameter to the parameters property of this instance of Link.
      Parameters:
      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.
      Returns:
      the current Link instance
    • removeParameter

      void removeParameter(String name)
      Remove a new parameter to the parameters property of this instance of Link.
      Parameters:
      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).
    • getDescription

      String getDescription()
      Returns the description property from a Link instance.
      Returns:
      a description of the link
    • setDescription

      void setDescription(String description)
      Sets this Link's description property to the given string.
      Parameters:
      description - a description of the link
    • description

      default Link description(String description)
      Sets this Link's description property to the given string.
      Parameters:
      description - a description of the link
      Returns:
      the current Link instance