---
lang: en
title: 'API docs: rest.resthttperrors.invaliddata'
keywords: LoopBack 4.0, LoopBack 4, Node.js, TypeScript, OpenAPI
sidebar: lb4_sidebar
editurl: https://github.com/loopbackio/loopback-next/tree/master/packages/rest
permalink: /doc/en/lb4/apidocs.rest.resthttperrors.invaliddata.html
---

<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@loopback/rest](./rest.md) &gt; [RestHttpErrors](./rest.resthttperrors.md) &gt; [invalidData](./rest.resthttperrors.invaliddata.md)

## RestHttpErrors.invalidData() function

**Signature:**

```typescript
function invalidData<T, Props extends object = {}>(data: T, name: string, extraProperties?: Props): HttpErrors.HttpError & Props;
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td markdown="1">

data


</td><td markdown="1">

T


</td><td markdown="1">


</td></tr>
<tr><td markdown="1">

name


</td><td markdown="1">

string


</td><td markdown="1">


</td></tr>
<tr><td markdown="1">

extraProperties


</td><td markdown="1">

Props


</td><td markdown="1">

_(Optional)_


</td></tr>
</tbody></table>

**Returns:**

HttpErrors.HttpError &amp; Props


