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

public Interface Example

extends Constructible, Extensible<Example>, Reference<Example>
Imports
org.eclipse.microprofile.openapi.models.Constructible, .Extensible, .Reference

Example

An object containing sample data for the related object.

In all cases, the example value is expected to be compatible with the type schema of its associated value. Tooling implementations MAY choose to validate compatibility automatically, and reject the example value(s) if incompatible.

See Also
OpenAPI Specification Example Object

Method Summary

Modifier and TypeMethod and Description
public default Example

Returns:

the current Example object
description
(String
long description of the example
description
)

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

public default Example

Returns:

the current Example object
externalValue
(String
URL that points to the literal example
externalValue
)

Sets this Example's externalValue property to the given string.

public String

Returns:

long description of the example
getDescription
()

Returns the description property from an Example instance.

public String

Returns:

URL that points to the literal example
getExternalValue
()

Returns the externalValue property from an Example instance.

public String

Returns:

short description of the example
getSummary
()

Returns the summary property from an Example instance.

public Object

Returns:

embedded literal example object
getValue
()

Returns the value property from an Example instance.

public void
setDescription(String
long description of the example
description
)

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

public void
setExternalValue(String
URL that points to the literal example
externalValue
)

Sets this Example's externalValue property to the given string.

public void
setSummary(String
short description of the example
summary
)

Sets this Example's summary property to the given string.

public void
setValue(Object
a literal example object
value
)

Sets this Example's value property to the given value.

public default Example

Returns:

the current Example object
summary
(String
short description of the example
summary
)

Sets this Example's summary property to the given string.

public default Example

Returns:

the current Example object
value
(Object
a literal example object
value
)

Sets this Example's value property to the given value.

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

Method Detail

descriptionback to summary
public default Example description(String description)

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

Parameters
description:String

long description of the example

Returns:Example

the current Example object

externalValueback to summary
public default Example externalValue(String externalValue)

Sets this Example's externalValue property to the given string. The value field and externalValue field are mutually exclusive.

Parameters
externalValue:String

URL that points to the literal example

Returns:Example

the current Example object

getDescriptionback to summary
public String getDescription()

Returns the description property from an Example instance.

Returns:String

long description of the example

getExternalValueback to summary
public String getExternalValue()

Returns the externalValue property from an Example instance.

Returns:String

URL that points to the literal example

getSummaryback to summary
public String getSummary()

Returns the summary property from an Example instance.

Returns:String

short description of the example

getValueback to summary
public Object getValue()

Returns the value property from an Example instance.

Returns:Object

embedded literal example object

setDescriptionback to summary
public void setDescription(String description)

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

Parameters
description:String

long description of the example

setExternalValueback to summary
public void setExternalValue(String externalValue)

Sets this Example's externalValue property to the given string. The value field and externalValue field are mutually exclusive.

Parameters
externalValue:String

URL that points to the literal example

setSummaryback to summary
public void setSummary(String summary)

Sets this Example's summary property to the given string.

Parameters
summary:String

short description of the example

setValueback to summary
public void setValue(Object value)

Sets this Example's value property to the given value. The value field and externalValue field are mutually exclusive.

Parameters
value:Object

a literal example object

summaryback to summary
public default Example summary(String summary)

Sets this Example's summary property to the given string.

Parameters
summary:String

short description of the example

Returns:Example

the current Example object

valueback to summary
public default Example value(Object value)

Sets this Example's value property to the given value. The value field and externalValue field are mutually exclusive.

Parameters
value:Object

a literal example object

Returns:Example

the current Example object