---
lang: en
title: 'API docs: repository.buildmodeldefinition'
keywords: LoopBack 4.0, LoopBack 4
sidebar: lb4_sidebar
permalink: /doc/en/lb4/apidocs.repository.buildmodeldefinition.html
---

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

[Home](./index.md) &gt; [@loopback/repository](./repository.md) &gt; [buildModelDefinition](./repository.buildmodeldefinition.md)

## buildModelDefinition() function

Build model definition from decorations

<b>Signature:</b>

```typescript
export declare function buildModelDefinition(target: Function & {
    definition?: ModelDefinition | undefined;
}, def?: ModelDefinitionSyntax): ModelDefinition;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  target | <code>Function &amp; {</code><br/><code>    definition?: ModelDefinition &#124; undefined;</code><br/><code>}</code> | Target model class |
|  def | <code>ModelDefinitionSyntax</code> | Model definition spec |

<b>Returns:</b>

`ModelDefinition`


