Page Contents
Home > @loopback/rest > validateValueAgainstSchema
validateValueAgainstSchema() function
Validate the value against JSON schema.
Signature:
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 | Schema references. |
| options | ValueValidationOptions | Value validation options. |
Returns:
Promise<any>