Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface ErrorValidationOptions

Hierarchy

Index

Properties

Optional abortEarly

0.0.46 provide
abortEarly: boolean

when true, stops validation on the first error, otherwise returns all the errors found.

default

true

Optional allowUnknown

0.0.46 provide
allowUnknown: boolean

when true, allows object to contain unknown keys which are ignored.

default

false

Optional cache

0.0.46 provide
cache: boolean

when true, schema caching is enabled (for schemas with explicit caching rules).

default

false

Optional context

0.0.46 provide
context: Context

provides an external data set to be used in references

Optional convert

0.0.46 provide
convert: boolean

when true, attempts to cast values to the required types (e.g. a string to a number).

default

true

Optional dateFormat

0.0.46 provide
dateFormat: "string" | "date" | "iso" | "time" | "utc"

sets the string format used when converting dates to strings in error messages and casting.

default

'iso'

Optional debug

0.0.46 provide
debug: boolean

when true, valid results and throw errors are decorated with a debug property which includes an array of the validation steps used to generate the returned result.

default

false

Optional errors

0.0.46 provide

error formatting settings.

Optional externals

0.0.46 provide
externals: boolean

if false, the external rules set with any.external() are ignored, which is required to ignore any external validations in synchronous mode (or an exception is thrown).

default

true

Optional messages

0.0.46 provide
messages: Record<string, LanguageMessageTemplate>

Optional noDefaults

0.0.46 provide
noDefaults: boolean

when true, do not apply default values.

default

false

Optional nonEnumerables

0.0.46 provide
nonEnumerables: boolean

when true, inputs are shallow cloned to include non-enumerables properties.

default

false

Optional presence

0.0.46 provide
presence: "optional" | "required" | "forbidden"

sets the default presence requirements. Supported modes: 'optional', 'required', and 'forbidden'.

default

'optional'

Optional skipFunctions

0.0.46 provide
skipFunctions: boolean

when true, ignores unknown keys with a function value.

default

false

Optional stripUnknown

0.0.46 provide
stripUnknown: boolean | { arrays?: boolean; objects?: boolean }

remove unknown elements from objects and arrays.

  • when true, all unknown elements will be removed
  • when an object:
    • objects - set to true to remove unknown keys from objects
default

false