@loopback/docs
Version:
Documentation for LoopBack 4
35 lines (22 loc) • 1.12 kB
Markdown
---
lang: en
title: 'API docs: metadata.decoratorfactory.inherit'
keywords: LoopBack 4.0, LoopBack 4
sidebar: lb4_sidebar
editurl: https://github.com/strongloop/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) > [@loopback/metadata](./metadata.md) > [DecoratorFactory](./metadata.decoratorfactory.md) > [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.
<b>Signature:</b>
```typescript
protected inherit(inheritedMetadata: T | undefined | null): T;
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| inheritedMetadata | <code>T | undefined | null</code> | Metadata from base classes for the member |
<b>Returns:</b>
`T`