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

<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@loopback/metadata](./metadata.md) &gt; [DecoratorFactory](./metadata.decoratorfactory.md) &gt; [inherit](./metadata.decoratorfactory.inherit.md)

## DecoratorFactory.inherit() method

Inherit metadata from base classes. By default, this method merges base metadata into the spec if `allowInheritance` is set to `true`<!-- -->. To customize the behavior, this method can be overridden by sub classes.

**Signature:**

```typescript
protected inherit(inheritedMetadata: T | undefined | null): T;
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td markdown="1">

inheritedMetadata


</td><td markdown="1">

T \| undefined \| null


</td><td markdown="1">

Metadata from base classes for the member


</td></tr>
</tbody></table>

**Returns:**

T


