Page Contents

Home > @loopback/rest > ValidationOptions

ValidationOptions interface

Options for request body validation using AJV

Signature:

export interface ValidationOptions extends ajv.Options 

Extends: ajv.Options

Properties

Property Type Description
ajvErrors? true | 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: ajv.ErrorObject[]) => ajv.ErrorObject[] (Optional) A function that transform the ErrorObjects reported by AJV. This could be used for error messages customization, localization, etc.
ajvFactory? (options: ajv.Options) => Ajv (Optional) A factory to create Ajv instance
ajvKeywords? true | string[] (Optional) Enable additional AJV keywords from https://github.com/epoberezkin/ajv-keywords - true: Add all keywords from 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__.