Skip to Content
OpenAPI HubResponsesLinks

OpenAPI Links

The Links object is a map of Link Objects or References to Link Objects that allows for describing possible API-use scenarios between different operations. For example, if a response returns a Drink object, and the Drink object has an ingredients property that is a list of Ingredient objects, then a link can be defined to the listIngredients operation showing how the ingredients can be used as an input to the listIngredients operation.

For example:

The Link Object represents a possible link that can be followed from the response.

Link Object Fields

FieldTypeRequiredDescription
StringThe
of an operation that exists in the document. Use either this field or the
field, not both.
StringEither a Relative Reference or Absolute Reference to an operation that exists in the document. Use either this field or the
field, not both.
StringA description of the link and intentions for its use. This may contain CommonMark syntax  to provide a rich description.
Map[string, any | {Expression}]A map of parameters to pass to the linked operation. The key is the name of the parameter and the value is either a constant value or an Expression that will be evaluated. The parameter name can also be qualified with the location of the parameter, for example,
or
Any | {Expression}A constant value or Expression that will be used as the request body when calling the linked operation.
Server ObjectAn optional server to be used by the linked operation.
ExtensionsAny number of extension fields can be added to the link object that can be used by tooling and vendors.

An example of OperationRef:

Last updated on