Page Contents

Home > @loopback/rest > ValidationOptions

ValidationOptions interface

Options for request body validation using AJV


export interface ValidationOptions extends ajv.Options 

Extends: ajv.Options


Property Type Description
ajvErrors true | AjvErrorOptions Enable custom error messages in JSON-Schema for AJV validator from - true: Enable ajv-errors - AjvErrorOptions: Enable ajv-errors with options
ajvErrorTransformer (errors: ajv.ErrorObject[]) => ajv.ErrorObject[] A function that transform the ErrorObjects reported by AJV. This could be used for error messages customization, localization, etc.
ajvFactory (options: ajv.Options) => Ajv A factory to create Ajv instance
ajvKeywords true | string[] Enable additional AJV keywords from - true: Add all keywords from ajv-keywords - string[]: Add an array of keywords from ajv-keywords
compiledSchemaCache SchemaValidatorCache Custom cache for compiled schemas by AJV. This setting makes it possible to skip the default cache.