---
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

|  Parameter | Type | Description |
|  --- | --- | --- |
|  value | any | The data value. |
|  schema | SchemaObject \| ReferenceObject | The JSON schema used to perform the validation. |
|  globalSchemas | SchemasObject | _(Optional)_ Schema references. |
|  options | [ValueValidationOptions](./rest.valuevalidationoptions.md) | _(Optional)_ Value validation options. |

**Returns:**

Promise&lt;any&gt;


