---
lang: en
title: 'API docs: metadata.propertydecoratorfactory.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.propertydecoratorfactory.createdecorator.html
---

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

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

## PropertyDecoratorFactory.createDecorator() method

Create a property decorator function

<b>Signature:</b>

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

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  key | [MetadataKey](./metadata.metadatakey.md)<!-- -->&lt;S, PropertyDecorator&gt; | Metadata key |
|  spec | S | Metadata object from the decorator function |
|  options | [DecoratorOptions](./metadata.decoratoroptions.md) | <i>(Optional)</i> Options for the decorator |

<b>Returns:</b>

PropertyDecorator


