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.

interface ExampleObject {
    description?: string;
    externalValue?: string;
    summary?: string;
    value?: any;
}

Hierarchy (view full)

Properties

description?: string

Long description for the example. CommonMark syntax MAY be used for rich text representation.

externalValue?: string

A URI that points to the literal example. This provides the capability to reference examples that cannot easily be included in JSON or YAML documents. The value field and externalValue field are mutually exclusive. See the rules for resolving Relative References.

summary?: string

Short description for the example.

value?: any

Embedded literal example. The value field and externalValue field are mutually exclusive. To represent examples of media types that cannot naturally represented in JSON or YAML, use a string value to contain the example, escaping where necessary.