Page Contents

Home > @loopback/rest > RequestBodyValidationOptions

RequestBodyValidationOptions interface

Options for request body validation using AJV

Signature:

export interface RequestBodyValidationOptions extends ajv.Options 

Properties

Property Type Description
ajvErrors true | AjvErrorOptions 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[] A function that transform the ErrorObjects reported by AJV. This could be used for error messages customization, localization, etc.
ajvKeywords true | string[] 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 Custom cache for compiled schemas by AJV. This setting makes it possible to skip the default cache.