UNPKG

@canard/schema-form-ajv7-plugin

Version:

AJV 7.x validator plugin for @canard/schema-form providing JSON Schema validation with Draft-07 and Draft 2019-09 support

14 lines (13 loc) 656 B
import type { JsonSchema, ValidateFunction } from '@canard/schema-form'; import type Ajv from 'ajv'; /** * Creates a validator factory function that transforms AJV7 error dataPaths. * * This factory function creates validators that handle AJV7's dataPath format. * AJV7 uses JSONPointer format by default, but we still need to handle * required field errors specially to append the missing property name. * * @param ajv - The AJV7 instance to use for validation * @returns A factory function that creates validators for given JSON schemas */ export declare const createValidatorFactory: (ajv: Ajv) => (jsonSchema: JsonSchema) => ValidateFunction;