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

public Interface Callback

extends Constructible, Extensible<Callback>, Reference<Callback>
Imports
java.util.Map, org.eclipse.microprofile.openapi.models.Constructible, .Extensible, .PathItem, .Reference

Callback

A map of possible out-of-band callbacks related to the parent operation. Each value in the map is a Path Item Object that describes a set of requests that may be initiated by the API provider and the expected responses. The key value used to identify the callback object is an expression, evaluated at runtime, that identifies a URL to use for the callback operation.

See Also
OpenAPI Specification Callback Object

Method Summary

Modifier and TypeMethod and Description
public Callback

Returns:

the current Callback instance
addPathItem
(String
a runtime expression that can be evaluated in the context of a runtime HTTP request/response
name
,
PathItem
a path to add to this Callback's list of PathItems. null values will be rejected (implementation will throw an exception) or ignored.
pathItem
)

Adds the given PathItem to this Callback's list of PathItems using the string as its key.

public default PathItem

Returns:

the corresponding path item or null.
getPathItem
(String
a path name in the format valid for a Paths object.
name
)

Returns a path item for a given name.

public Map<String, PathItem>

Returns:

all items
getPathItems
()

Returns a copy map (potentially immutable) of the path items.

public default boolean

Returns:

a boolean to indicate if the path item is present or not.
hasPathItem
(String
a path name in the format valid for a Paths object.
name
)

Check whether a path item is present to the map.

public void
removePathItem(String
a path name that will be removed.
name
)

Removes the given path item of the Callback PathItems.

public void
setPathItems(Map<String, PathItem>
a map containing the list of paths.
items
)

Set the path items map to this Callback.

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

Method Detail

addPathItemback to summary
public Callback addPathItem(String name, PathItem pathItem)

Adds the given PathItem to this Callback's list of PathItems using the string as its key. The key that identifies the Path Item Object is a runtime expression that can be evaluated in the context of a runtime HTTP request/response to identify the URL to be used for the callback request. A simple example might be $request.body#/url. However, using a runtime expression the complete HTTP message can be accessed. This includes accessing any part of a body that a JSON Pointer RFC6901 can reference.

Parameters
name:String

a runtime expression that can be evaluated in the context of a runtime HTTP request/response

pathItem:PathItem

a path to add to this Callback's list of PathItems. null values will be rejected (implementation will throw an exception) or ignored.

Returns:Callback

the current Callback instance

getPathItemback to summary
public default PathItem getPathItem(String name)

Returns a path item for a given name. This is a convenience method for getPathItems().get(name)

Parameters
name:String

a path name in the format valid for a Paths object.

Returns:PathItem

the corresponding path item or null.

getPathItemsback to summary
public Map<String, PathItem> getPathItems()

Returns a copy map (potentially immutable) of the path items.

Returns:Map<String, PathItem>

all items

hasPathItemback to summary
public default boolean hasPathItem(String name)

Check whether a path item is present to the map. This is a convenience method for getPathItems().containsKey(name)

Parameters
name:String

a path name in the format valid for a Paths object.

Returns:boolean

a boolean to indicate if the path item is present or not.

removePathItemback to summary
public void removePathItem(String name)

Removes the given path item of the Callback PathItems.

Parameters
name:String

a path name that will be removed.

setPathItemsback to summary
public void setPathItems(Map<String, PathItem> items)

Set the path items map to this Callback.

Parameters
items:Map<String, PathItem>

a map containing the list of paths.