packages/docs/docs/api-reference/validator-ata.md
@rjsf/validator-ata is an alternative to @rjsf/validator-ajv8, backed by ata-validator instead of AJV.
The public surface mirrors the AJV package, so swapping the import is enough for the form to keep working: customizeValidator(), ValidatorType<T, S, F>, custom formats, transformErrors, customValidate, and suppressDuplicateFiltering all behave the same.
See the Validation documentation for examples of using these APIs.
@rjsf/validator-ajv8AjvClass, ajvFormatOptions, ajvOptionsOverrides) are not accepted. The closest equivalent is ataOptionsOverrides, which is spread on top of the default ata-validator options.ata-validator format set is always installed, so there is no opt-in flag for formats.ata-validator's error params are frozen, so the pre-quote pass that validator-ajv8 runs for ajv-i18n is unnecessary. Localizers that mutate message in place still work as-is.compileSchemaValidators / createPrecompiledValidator) are supported. ata-validator's bundleStandalone output is adapted into the validator function map the precompiled consumer expects. Error output matches the non-precompiled validator, including per-field errors for schema-valued additionalProperties (with ata-validator >= 0.17.4); an invalid anyOf reports a single error on the field, the same as the runtime path. One constraint carries over from the standalone (AOT) path: custom formats must be a RegExp or pre-anchored string pattern, since a function checker cannot be serialized into the bundle and is rejected at compile time.There are a few TypeScript types that are exported by @rjsf/validator-ata in support of the APIs. These types can be found on GitHub here.
Creates and returns a customized implementation of the ValidatorType with the given customization options if provided.
If a localizer is provided, it is used to translate the messages generated by the underlying ata-validator validation.
CustomValidatorOptionsType options that are used to create the ValidatorType instance. Supported options:
additionalMetaSchemas: Additional schemas registered for cross-schema $ref resolutioncustomFormats: Custom format checkers; values can be functions, RegExps, or pre-anchored regex source stringsataOptionsOverrides: Overrides spread on top of the default ata-validator options (e.g. coerceTypes, removeAdditional, verbose, abortEarly)extenderFn: A function called against the constructed Validator instance for additional setup; returning a different instance is supportedsuppressDuplicateFiltering: Controls filtering of duplicate anyOf/oneOf errors using the SuppressDuplicateFilteringType type. 'none' (default) filters duplicates for both; 'anyOf' suppresses filtering for anyOf (oneOf duplicates still filtered); 'oneOf' suppresses filtering for oneOf (anyOf duplicates still filtered); 'all' disables all duplicate filtering.ata-validator ValidationErrors after running the form validationCompiles a schema into an output file that can be loaded later as a precompiled validator.
The main reasons for using a precompiled validator are reducing code size, improving startup time by skipping schema compilation, and avoiding dynamic code generation when a browser's Content Security Policy forbids it.
Under the hood this calls ata-validator's bundleStandalone and wraps the result in the map the precompiled consumer expects.
NOTE: Custom formats passed through
options.customFormatsmust be a RegExp or a pre-anchored string pattern. A function checker cannot be serialized into the standalone bundle and is rejected at compile time.
CustomValidatorOptionsType options accepted by customizeValidator(), used to alter the validator that compiles the schemaCreates and returns a ValidatorType interface that is implemented with a precompiled validator.
If a localizer is provided, it is used to translate the messages generated by the underlying ata-validator validation.
NOTE: The
validateFnsparameter is an object obtained by importing from a precompiled validation file created via thecompileSchemaValidators()function.
compileSchemaValidators() functioncompileSchemaValidators() functionata-validator ValidationErrors after running the form validationSuppressDuplicateFilteringType | undefined - Controls filtering of duplicate anyOf/oneOf errors. See customizeValidator() for the full description of each value.