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?](/doc/en/lb4/apidocs.rest.validationoptions.ajverrors.html) | [AjvErrorOptions](/doc/en/lb4/apidocs.rest.ajverroroptions.html) | _(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?](/doc/en/lb4/apidocs.rest.validationoptions.ajverrortransformer.html) | (errors: ErrorObject\[\]) => ErrorObject\[\] | _(Optional)_ A function that transform the `ErrorObject`s reported by AJV. This could be used for error messages customization, localization, etc. | |
| [ajvFactory?](/doc/en/lb4/apidocs.rest.validationoptions.ajvfactory.html) | (options: AjvOptions) => Ajv | _(Optional)_ A factory to create Ajv instance | |
| [ajvKeywords?](/doc/en/lb4/apidocs.rest.validationoptions.ajvkeywords.html) | string\[\] | _(Optional)_ Enable additional AJV keywords from https://github.com/epoberezkin/ajv-keywords - `string[]`: Add an array of keywords from `ajv-keywords` | |
| [compiledSchemaCache?](/doc/en/lb4/apidocs.rest.validationoptions.compiledschemacache.html) | [SchemaValidatorCache](/doc/en/lb4/apidocs.rest.schemavalidatorcache.html) | _(Optional)_ Custom cache for compiled schemas by AJV. This setting makes it possible to skip the default cache. | |
| [prohibitedKeys?](/doc/en/lb4/apidocs.rest.validationoptions.prohibitedkeys.html) | string\[\] | _(Optional)_ An array of keys to be rejected, such as `__proto__`. |