---
lang: en
title: 'API docs: rest.validatevalueagainstschema'
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.validatevalueagainstschema.html
---

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

[Home](./index.md) &gt; [@loopback/rest](./rest.md) &gt; [validateValueAgainstSchema](./rest.validatevalueagainstschema.md)

## validateValueAgainstSchema() function

Validate the value against JSON schema.

**Signature:**

```typescript
export declare function validateValueAgainstSchema(value: any, schema: SchemaObject | ReferenceObject, globalSchemas?: SchemasObject, options?: ValueValidationOptions): Promise<any>;
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

value


</td><td>

any


</td><td>

The data value.


</td></tr>
<tr><td>

schema


</td><td>

SchemaObject \| ReferenceObject


</td><td>

The JSON schema used to perform the validation.


</td></tr>
<tr><td>

globalSchemas


</td><td>

SchemasObject


</td><td>

_(Optional)_ Schema references.


</td></tr>
<tr><td>

options


</td><td>

[ValueValidationOptions](./rest.valuevalidationoptions.md)


</td><td>

_(Optional)_ Value validation options.


</td></tr>
</tbody></table>
**Returns:**

Promise&lt;any&gt;


