Page Contents

Home > @loopback/rest > ValidationOptions

ValidationOptions interface

Options for request body validation using AJV


export interface ValidationOptions extends AjvOptions 

Extends: AjvOptions


Property Modifiers Type Description
ajvErrors?   AjvErrorOptions (Optional) Enable custom error messages in JSON-Schema for AJV validator from - 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 - 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__.