Page Contents

Home > @loopback/openapi-spec-builder > ComponentsSpecBuilder > withExample

ComponentsSpecBuilder.withExample() method

Define a component example.

Signature:

withExample(name: string, example: ExampleObject | ReferenceObject): this;

Parameters

Parameter Type Description
name string The name of the example
example ExampleObject | ReferenceObject Specification of the example

Returns:

this