---
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.

<b>Signature:</b>

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

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  value | any | The data value. |
|  schema | SchemaObject \| ReferenceObject | The JSON schema used to perform the validation. |
|  globalSchemas | SchemasObject | <i>(Optional)</i> Schema references. |
|  options | [ValueValidationOptions](./rest.valuevalidationoptions.md) | <i>(Optional)</i> Value validation options. |

<b>Returns:</b>

Promise&lt;any&gt;


