---
lang: en
title: 'API docs: openapi-spec-builder.componentsspecbuilder.withparameter'
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.withparameter.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) &gt; [withParameter](./openapi-spec-builder.componentsspecbuilder.withparameter.md)

## ComponentsSpecBuilder.withParameter() method

Define a component parameter.

**Signature:**

```typescript
withParameter(name: string, parameter: ParameterObject | ReferenceObject): this;
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

name


</td><td>

string


</td><td>

The name of the parameter


</td></tr>
<tr><td>

parameter


</td><td>

ParameterObject \| ReferenceObject


</td><td>

Specification of the parameter


</td></tr>
</tbody></table>

**Returns:**

this


