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

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

[Home](./index.md) &gt; [@loopback/metadata](./metadata.md) &gt; [ParameterDecoratorFactory](./metadata.parameterdecoratorfactory.md) &gt; [createDecorator](./metadata.parameterdecoratorfactory.createdecorator.md)

## ParameterDecoratorFactory.createDecorator() method

Create a parameter decorator function

**Signature:**

```typescript
static createDecorator<S>(key: MetadataKey<S, ParameterDecorator>, spec: S, options?: DecoratorOptions): ParameterDecorator;
```

## Parameters

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

Parameter


</th><th>

Type


</th><th>

Description


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

key


</td><td>

[MetadataKey](./metadata.metadatakey.md)<!-- -->&lt;S, ParameterDecorator&gt;


</td><td>

Metadata key


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

spec


</td><td>

S


</td><td>

Metadata object from the decorator function


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

options


</td><td>

[DecoratorOptions](./metadata.decoratoroptions.md)


</td><td>

_(Optional)_ Options for the decorator


</td></tr>
</tbody></table>
**Returns:**

ParameterDecorator


