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

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

[Home](./index.md) &gt; [@loopback/metadata](./metadata.md) &gt; [MetadataInspector](./metadata.metadatainspector.md) &gt; [getPropertyMetadata](./metadata.metadatainspector.getpropertymetadata.md)

## MetadataInspector.getPropertyMetadata() method

Get the metadata associated with the given key for a given property of the target class or prototype

**Signature:**

```typescript
static getPropertyMetadata<T>(key: MetadataKey<T, PropertyDecorator>, target: Object, propertyName: string, options?: InspectionOptions): T | undefined;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  key | [MetadataKey](./metadata.metadatakey.md)<!-- -->&lt;T, PropertyDecorator&gt; | Metadata key |
|  target | Object | Class for static properties or prototype for instance properties |
|  propertyName | string | Property name |
|  options | [InspectionOptions](./metadata.inspectionoptions.md) | _(Optional)_ Options for inspection |

**Returns:**

T \| undefined


