@canard/schema-form-ajv6-plugin
Version:
AJV 6.x validator plugin for @canard/schema-form providing JSON Schema validation with legacy Draft-04, Draft-06, and Draft-07 support
13 lines (12 loc) • 616 B
TypeScript
import type { JsonSchema, ValidateFunction } from '@canard/schema-form';
import type { Ajv } from 'ajv';
/**
* Creates a validator factory function that transforms AJV6 error dataPaths.
*
* This factory function creates validators that automatically convert AJV6's JSONPath format
* error dataPaths to JSONPointer format for consistency with the schema-form library.
*
* @param ajv - The AJV 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;