---
lang: en
title: 'API docs: openapi-spec-builder.componentsspecbuilder'
keywords: LoopBack 4.0, LoopBack 4, Node.js, TypeScript, OpenAPI
sidebar: lb4_sidebar
editurl: https://github.com/loopbackio/loopback-next/tree/master/packages/openapi-spec-builder
permalink: /doc/en/lb4/apidocs.openapi-spec-builder.componentsspecbuilder.html
---

<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@loopback/openapi-spec-builder](./openapi-spec-builder.md) &gt; [ComponentsSpecBuilder](./openapi-spec-builder.componentsspecbuilder.md)

## ComponentsSpecBuilder class

A builder for creating ComponentsObject specifications.

**Signature:**

```typescript
export declare class ComponentsSpecBuilder extends BuilderBase<ComponentsObject> 
```
**Extends:** [BuilderBase](./openapi-spec-builder.builderbase.md)<!-- -->&lt;ComponentsObject&gt;

## Constructors

|  Constructor | Modifiers | Description |
|  --- | --- | --- |
|  [(constructor)()](./openapi-spec-builder.componentsspecbuilder._constructor_.md) |  | Constructs a new instance of the <code>ComponentsSpecBuilder</code> class |

## Methods

|  Method | Modifiers | Description |
|  --- | --- | --- |
|  [withCallback(name, callback)](./openapi-spec-builder.componentsspecbuilder.withcallback.md) |  | Define a component callback. |
|  [withExample(name, example)](./openapi-spec-builder.componentsspecbuilder.withexample.md) |  | Define a component example. |
|  [withHeader(name, header)](./openapi-spec-builder.componentsspecbuilder.withheader.md) |  | Define a component header. |
|  [withLink(name, link)](./openapi-spec-builder.componentsspecbuilder.withlink.md) |  | Define a component link. |
|  [withParameter(name, parameter)](./openapi-spec-builder.componentsspecbuilder.withparameter.md) |  | Define a component parameter. |
|  [withRequestBody(name, requestBody)](./openapi-spec-builder.componentsspecbuilder.withrequestbody.md) |  | Define a component request body. |
|  [withResponse(name, response)](./openapi-spec-builder.componentsspecbuilder.withresponse.md) |  | Define a component response. |
|  [withSchema(name, schema)](./openapi-spec-builder.componentsspecbuilder.withschema.md) |  | Define a component schema. |
|  [withSecurityScheme(name, securityScheme)](./openapi-spec-builder.componentsspecbuilder.withsecurityscheme.md) |  | Define a component security scheme. |


