Page Contents

Home > @loopback/rest > ValidationOptions

ValidationOptions interface

Options for request body validation using AJV

Signature:

export interface ValidationOptions extends AjvOptions 

Extends: AjvOptions

Properties

Property Modifiers Type Description
ajvErrors?   AjvErrorOptions (Optional) Enable custom error messages in JSON-Schema for AJV validator from https://github.com/epoberezkin/ajv-errors - true: Enable ajv-errors - AjvErrorOptions: Enable ajv-errors with options
ajvErrorTransformer?   (errors: ErrorObject[]) => ErrorObject[] (Optional) A function that transform the ErrorObjects reported by AJV. This could be used for error messages customization, localization, etc.
ajvFactory?   (options: AjvOptions) => Ajv (Optional) A factory to create Ajv instance
ajvKeywords?   string[] (Optional) Enable additional AJV keywords from https://github.com/epoberezkin/ajv-keywords - string[]: Add an array of keywords from ajv-keywords
compiledSchemaCache?   SchemaValidatorCache (Optional) Custom cache for compiled schemas by AJV. This setting makes it possible to skip the default cache.
prohibitedKeys?   string[] (Optional) An array of keys to be rejected, such as __proto__.