---
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

|  Parameter | Type | Description |
|  --- | --- | --- |
|  name | string | The name of the parameter |
|  parameter | ParameterObject \| ReferenceObject | Specification of the parameter |

**Returns:**

this


