Page Contents

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

ComponentsSpecBuilder.withSchema() method

Define a component schema.

Signature:

withSchema(name: string, schema: SchemaObject | ReferenceObject): this;

Parameters

Parameter Type Description
name string The name of the schema
schema SchemaObject | ReferenceObject Specification of the schema

Returns:

this